oshaker Posted February 21, 2010 Share Posted February 21, 2010 #include "mysql.au3" $objErr = ObjEvent("AutoIt.Error","MyErrFunc") Dim $var, $sql $sql = _MySQLConnect("UserName","Password","DB_Name","DB_IP_Address") $var = _Query($sql,"SELECT user.user_id, user.firstname,user.username,course.code FROM dokeos_main.user ,dokeos_main.course_rel_user, dokeos_main.course where user.user_id=course_rel_user.user_id and course_rel_user.course_code=course.code" ) FileOpen ( "c:\test.txt", 130) With $var While NOT .EOF FileWriteLine("c:\test.txt",.Fields("username").value & "," & .Fields("firstname").value & .Fields("code").value & @CRLF) .MoveNext WEnd EndWith _MySQLEnd($sql) Func MyErrFunc() $hexnum=hex($objErr.number,8) Msgbox(0,"","We intercepted a COM Error!!" & @CRLF & @CRLF & _ "err.description is: " & $objErr.description & @CRLF & _ "err.windescription is: " & $objErr.windescription & @CRLF & _ "err.lastdllerror is: " & $objErr.lastdllerror & @CRLF & _ "err.scriptline is: " & $objErr.scriptline & @CRLF & _ "err.number is: " & $hexnum & @CRLF & _ "err.source is: " & $objErr.source & @CRLF & _ "err.helpfile is: " & $objErr.helpfile & @CRLF & _ "err.helpcontext is: " & $objErr.helpcontext _ ) exit EndFunc This gives me: Only Object-type variables allowed in a "With" statement. With $var With ^ ERROR How can I fix it? Link to comment Share on other sites More sharing options...
BrettF Posted February 21, 2010 Share Posted February 21, 2010 From memory that function returns an array. So For...Next will do the job. See what the function returns first though. Should be some documentation in MySQL.au3. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
oshaker Posted February 23, 2010 Author Share Posted February 23, 2010 re-installing the ODBC MySQL driver solved the problem. Link to comment Share on other sites More sharing options...
Rambo Posted March 11, 2010 Share Posted March 11, 2010 Hello. Im getting the same error with my script. Well, the scripts works fine in my PC but im getting this error on another computer... RegardsCentinelav2.exeCentinelav2.au3 Link to comment Share on other sites More sharing options...
BrettF Posted March 12, 2010 Share Posted March 12, 2010 Add some error checking in to see exactly where it fails Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Rambo Posted March 12, 2010 Share Posted March 12, 2010 I introduced the code from ptrex http://www.autoitscript.com/forum/index.php?showtopic=111169&view=findpost&p=781749And the result was this: Link to comment Share on other sites More sharing options...
BrettF Posted March 13, 2010 Share Posted March 13, 2010 I am unable to replicate but some observations. You called ObjCreate like 10 times in the one function. There was no need for it and I opened the object at the start of the script. Other than that there were no real problems I could see (or test). Please grab the full version of SciTE and run it from there. Past the console output, so at least we know where the error is coming from. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Rambo Posted March 15, 2010 Share Posted March 15, 2010 error is get by $com. In code line "With $com" Link to comment Share on other sites More sharing options...
BrettF Posted March 15, 2010 Share Posted March 15, 2010 (edited) Which one? There are 4 different occurrences of it? What does that error mean in ENGLISH? Have you Googled the error and the error code? Edited March 15, 2010 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Bowmore Posted March 15, 2010 Share Posted March 15, 2010 The error is that the "MSCommLib.MSComm" object is not being created. If this is working on your PC but not on anther PC then I would suspect that the PC on which it is not working does not have "MSCommLib.MSComm" installed. I don't believe that MScomm is a standard component of windows. check if this file exists on the PC with the problem "C:\WINDOWS\system32\MSCOMM32.OCX". "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
LoWang Posted May 4, 2010 Share Posted May 4, 2010 (edited) It happenes to me as well but on random computers in our company. Just now one computer was failing to connect on line $Objconn.open in _MySQLConnect function and that Comerror handler failed to catch it although it works in other cases! Is it because I compiled it with Autoit 3.3.0.0? Unfortunatelly I restarted the computer and then it works again without error! So I will have to wait when it happens next time :-\ Edited May 4, 2010 by LoWang 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