Solved

VB.net Access Not a valid bokmark

Posted on 2013-01-31
5
339 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now