tjessejeff
Programmer
I have the following code that is suppose to search a table for a match. If the end of the file is reached, then the record does not exist. The problem I am getting is "THE OPERATION REQUESTED BY THE APPLICATION IS NOT ALLOW..."
' Open ADO recordset from Problem_ID table
stringConnection = "provider=microsoft.jet.oledb.4.0; " _
& "data source=c:\rcas\VB6System\rcas_VB6DB.mdb"
Set rsProblem_ID = New ADODB.Recordset
' OpenDynamic so changes can be made to data
rsProblem_ID.CursorType = adOpenDynamic
' Build SQL statement to search Problem ID table
SQL_Statement = "SELECT * FROM [problem id] " _
& "WHERE [problem id] = '" & Problem_ID & "' "
' Open the recordset
rsProblem_ID.Open SQL_Statement, stringConnection
' Check to see if record is found
If rsProblem_ID.EOF = True Then
' Record is not found
The book I used states that the format is correct, but no match is followed. The table has three records in it.
' Open ADO recordset from Problem_ID table
stringConnection = "provider=microsoft.jet.oledb.4.0; " _
& "data source=c:\rcas\VB6System\rcas_VB6DB.mdb"
Set rsProblem_ID = New ADODB.Recordset
' OpenDynamic so changes can be made to data
rsProblem_ID.CursorType = adOpenDynamic
' Build SQL statement to search Problem ID table
SQL_Statement = "SELECT * FROM [problem id] " _
& "WHERE [problem id] = '" & Problem_ID & "' "
' Open the recordset
rsProblem_ID.Open SQL_Statement, stringConnection
' Check to see if record is found
If rsProblem_ID.EOF = True Then
' Record is not found
The book I used states that the format is correct, but no match is followed. The table has three records in it.