Sign in to follow this  
Followers 0
spanga

Selecting empty row with mysql odbc

3 posts in this topic

I am using this script to make querys to my mysql database. On the computer (win2k) running the mysql database. I get an error when selecting an empty field. On my two other computers (win xp, win xp x64) the same queries works fine. The error I get is:

$cmboval = $cmboval & "" & .Fields ($u).Value

$cmboval = $cmboval & "" & .Fields ($u).Value^ ERROR

Error: Error in expression

Anyone got any clues?

CODE
$adoCon = ObjCreate ("ADODB.Connection")

$adoCon.Open ("Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Option=3; Database=x; Uid=x; Pwd=x;")

$adoRs = ObjCreate ("ADODB.Recordset")

$adoRs.CursorType = 2

$adoRs.LockType = 3

$adoRs.Open ($qry, $adoCon)

$cmboval = ""

With $adoRs

If $vars > 0 Then

$count = 0

While Not .EOF

$count += 1

For $u = 0 To $vars - 1 Step 1

$cmboval = $cmboval & "" & .Fields ($u).Value

If $u < $vars - 1 Then $cmboval = $cmboval & "|"

Next

.MoveNext

WEnd

EndIf

EndWith

$adoCon.Close

Return $cmboval

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Show how you find $vars - number of columns. Is that value correct on WIN2k?

And what is in $qry?

$vars and $qry are both function parameters. $vars is always 1... if not an insert, then 0 (both set manually). $qry is the query, as in this case "SELECT old FROM users WHERE ukey='" & $ukey & "'"

Tbh I don't think this is related to AutoIt, but to myodbc or some of the other components in this mess. Just don't know where to ask :P

Edited by spanga

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0