Jump to content
Sign in to follow this  

Selecting empty row with mysql odbc

Recommended Posts

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?

$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 & "|"







Return $cmboval

Share this post

Link to post
Share on other sites

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...