laffo16 Posted October 21, 2006 Share Posted October 21, 2006 (edited) Hi im trying to connect autoit to my mdb access db. the problem i think im having is that because the mdb is updated automaticly every minute (each update last aprox 4 seconds), if the script is checking the mdb while its updating an error occures. now i'm not totally sure at all that this is the case, just guessing. here is part of my code. Func quitsession($chiptablename1) Local $oRS Local $oConn $chiptablename = $chiptablename1 $oConn = ObjCreate("ADODB.Connection") $oRS = ObjCreate("ADODB.Recordset") $oConn.Open("Driver={Microsoft Access Driver (*.mdb)};Dbq=" & $ptracker) $oRS.Open("UPDATE session SET seclosed = '1' WHERE (session.table_name='" & $chiptablename & "') AND (session.player_id=" & $storeuserid & ") AND (session.site_id=" & $storesiteid & ") AND (session.seclosed is NULL);", $oConn, 1, 3) $oConn.Close $oConn = 0 EndFunc the error is: $oRS.Open("UPDATE session SET seclosed = '1' WHERE (session.table_name='" & $chiptablename & "') AND (session.player_id=" & $storeuserid & ") AND (session.site_id=" & $storesiteid & ") AND (session.seclosed is NULL);", $oConn, 1, 3)^ERROR Error: The requested action with this object has failed. and my script bombs out from their. i have tried the if @error =1 then Return 0 but i dont think it applies to this sort of error. does anyone out their know how i can go about Return 0 this function when this occures to continue the script. thank you, Edited October 22, 2006 by laffo16 Link to comment Share on other sites More sharing options...
laffo16 Posted October 22, 2006 Author Share Posted October 22, 2006 *bump Link to comment Share on other sites More sharing options...
laffo16 Posted October 22, 2006 Author Share Posted October 22, 2006 this a good post to read for those wanting to learn some COM error handling,http://www.autoitscript.com/forum/index.php?showtopic=31509 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