Murray Brown
asked on
VB.net Access Not a valid bokmark
Hi. I am running the following code on two machines. On the machine that has Access it runs fine, but on the machine that doesn't have Access I get the error "Not a valid bookmark". Access was just copied as a .accdb file onto the machine that doesn't have MS Access. It has worked well for a year and suddenly this error
Dim sSQL As String
sSQL = "SELECT Info FROM Transactions WHERE TransactionID = " & sString & ""
If My.Settings.Setting_Compan yID <> "" And My.Settings.Setting_Compan yID <> Nothing Then
sSQL = sSQL & " And Co_ID = " & My.Settings.Setting_Compan yID
End If
Dim connection As New OleDbConnection(My.Setting s.CS_Setti ng)
Dim cmd As New OleDbCommand(sSQL, connection)
connection.Open()
Get_Info_Field = cmd.ExecuteScalar().ToStri ng
connection.Close()
Dim sSQL As String
sSQL = "SELECT Info FROM Transactions WHERE TransactionID = " & sString & ""
If My.Settings.Setting_Compan
sSQL = sSQL & " And Co_ID = " & My.Settings.Setting_Compan
End If
Dim connection As New OleDbConnection(My.Setting
Dim cmd As New OleDbCommand(sSQL, connection)
connection.Open()
Get_Info_Field = cmd.ExecuteScalar().ToStri
connection.Close()
Are you sure the error is in this block? Is it the ExecuteScalar line that throws the error?
ASKER
Its hard to tell as the error only has a compiled version of my app on. The database looks like it was corrupt so I repaired it and still the error. The machine causing the errors has not got MS Access on and has a .accdb version instead of .accde (mess up by our install guy). Could this be the problem?
Not sure if that's the issue because never seen that sort of error with that type of code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
found the problem