Solved

VB.net Access Not a valid bokmark

Posted on 2013-01-31
5
359 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Murray Brown
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:
Murray Brown earned 0 total points
ID: 38850762
Turns out that Access was corrupt
0
 

Author Closing Comment

by:Murray Brown
ID: 38870783
found the problem
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

636 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