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_CompanyID <> "" And My.Settings.Setting_CompanyID <> Nothing Then
                sSQL = sSQL & " And Co_ID = " & My.Settings.Setting_CompanyID
            End If

                Dim connection As New OleDbConnection(My.Settings.CS_Setting)
                Dim cmd As New OleDbCommand(sSQL, connection)
                connection.Open()
                Get_Info_Field = cmd.ExecuteScalar().ToString
                connection.Close()
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
Murray BrownConnect With a Mentor Microsoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Turns out that Access was corrupt
0
 
CodeCruiserCommented:
Are you sure the error is in this block? Is it the ExecuteScalar line that throws the error?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
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?
0
 
CodeCruiserCommented:
Not sure if that's the issue because never seen that sort of error with that type of code.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
found the problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.