Solved

VB.net Access Not a valid bokmark

Posted on 2013-01-31
5
346 Views
Last Modified: 2013-02-09
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()
0
Comment
Question by:murbro
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38839188
Are you sure the error is in this block? Is it the ExecuteScalar line that throws the error?
0
 

Author Comment

by:murbro
ID: 38839197
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38839337
Not sure if that's the issue because never seen that sort of error with that type of code.
0
 

Accepted Solution

by:
murbro earned 0 total points
ID: 38850762
Turns out that Access was corrupt
0
 

Author Closing Comment

by:murbro
ID: 38870783
found the problem
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access report groups with sums 5 26
Create a EXCEL FIle from Access Procedure 1 13
Exporting Access Tables as CSV 3 23
trying to catch ODBC error when database opens 2 24
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question