Jump to content
Sign in to follow this  

Obj ADODB to Access MDB error. help pls

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 = 0

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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.