spanga Posted January 7, 2007 Share Posted January 7, 2007 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^ ERRORError: Error in expressionAnyone 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 Link to comment Share on other sites More sharing options...
Zedna Posted January 7, 2007 Share Posted January 7, 2007 Show how you find $vars - number of columns. Is that value correct on WIN2k? And what is in $qry? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
spanga Posted January 8, 2007 Author Share Posted January 8, 2007 (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 Edited January 8, 2007 by spanga Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now