Ghost21 Posted October 28, 2008 Share Posted October 28, 2008 If Not $oRS.EOF Then $oRS.Movenext Else EndIf Why does it keep crashing on EOF is the syntax wrong keep getting this error ==> The requested action with this object has failed.: ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 28, 2008 Share Posted October 28, 2008 If Not $oRS.EOF Then $oRS.Movenext Else EndIfWhy does it keep crashing on EOF is the syntax wrong keep getting this error ==> The requested action with this object has failed.Are you sure you have a valid record set object in $oRS? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Ghost21 Posted October 28, 2008 Author Share Posted October 28, 2008 Func stations() Call("dbOpen") $oRS.Open("SELECT * FROM stations", $oConn, 1, 3) Local $statid $statid = Random(0, $oRS.RecordCount, 1) $count = $oRS.RecordCount For $i = 1 To $count If $statid = $i Then $stationtype = $oRS.Fields("TYPE" ).value $id = $oRS.Fields("STATIONID" ).value $oldid = $id MsgBox(0, "PC Station ID Found. :" & $statid, $stationtype & " : " & $id, 2) Call("getdata", $id) Call("dbClose") Else EndIf If Not $oRS.EOF Then $oRS.Movenext Else $oRS.MoveFirst EndIf Next $id = "" $stationtype = "" Call("dbClose") EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 28, 2008 Share Posted October 28, 2008 Func stations() Call("dbOpen") $oRS.Open("SELECT * FROM stations", $oConn, 1, 3) Local $statid $statid = Random(0, $oRS.RecordCount, 1) $count = $oRS.RecordCount For $i = 1 To $count If $statid = $i Then $stationtype = $oRS.Fields("TYPE" ).value $id = $oRS.Fields("STATIONID" ).value $oldid = $id MsgBox(0, "PC Station ID Found. :" & $statid, $stationtype & " : " & $id, 2) Call("getdata", $id) Call("dbClose") Else EndIf If Not $oRS.EOF Then $oRS.Movenext Else $oRS.MoveFirst EndIf Next $id = "" $stationtype = "" Call("dbClose") EndFunc Aren't you doing 'Call("dbClose")' inside that IF condition before you try to use the record set? I assume "dbClose" closes the DB connection, and thereby invalidates the record set? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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