Jump to content

Obj ADODB to Access MDB error. help pls


laffo16
 Share

Recommended Posts

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 by laffo16
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...