473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Weird Intermitent Bug/Problem With VB Accessing MS Access

I'm driving myself crazy trying to figure this one out. So much so
that I think I'm within walking distance now!

The program is written and compiled in Visual Basic 6 with SP5. The
OS is Windows XP Professional.

The other day, it worked just fne. Today it doesn't. I had this same
problem a few weeks ago, but it mysteriously went away. Well, now
it's back. What did I change? I have no idea. Lot's of stuff, I
suppose. I don't access the offending program everyday, so it could
have been broken at any point.

This problem is NOT limited to just this program, but any program
using simillar data access code (see below for function).

I'm getting the following error when trying to run it: The dialog box
is displayed instead of program start:
=============================================

Run-time error '-2147024769(800700f)'.

Method '~' of object '~' failed

=============================================
Within VB, when running the program from <F5>, I get this:
=============================================

Run-time error '-2147024769(800700f)':

Method 'Open' of object' _Connection' failed

=============================================
Debugging the program brings us to this function. The offending line
is indicated:
=============================================

Public Function Phone_GetData()

Dim dbLoc
Dim db As Connection
Dim adoRecordSet As ADODB.Recordset

Set db = New ADODB.Connection
dbLoc = "C:\Program Files\PhonePad\Config.mdb"
' ********************* THIS IS THE LINE THAT BREAKS IT!
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & dbLoc &
";"
Set adoRecordSet = New ADODB.Recordset
adoRecordSet.Open "SELECT * FROM tblPhoneNumbers", _
db, adOpenDynamic, adLockOptimistic

adoRecordSet.MoveFirst
Do
oPhone.Add adoRecordSet.Fields("PhoneName"), _
adoRecordSet.Fields("PhoneNumber"), _
adoRecordSet.Fields("PhoneOther"), _
adoRecordSet.Fields("EntryDate")

adoRecordSet.MoveNext
Loop Until adoRecordSet.EOF

' Close RecordSet
Set adoRecordSet = Nothing

' Close Database
Set db = Nothing

End Function

=============================================
Disecting the offending line verifies that all is well with the
variable:
=============================================

From Immediate window:
? "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & dbLoc & ";"
PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Program
Files\PhonePad\Config.mdb;

=============================================
The pertinent Project References are:
=============================================

OLE Automation
Microsoft ActiveX Data Obects 2.7 Library

=============================================
I was using ADO 2.6 but upgraded the first time this error reared its
ugly head. That did not fix the problem.

Of course, Microsoft's site is of NO help. I found a few references
here & there on the 'net, but nothing specific to this problem, nor a
cure.

Any ideas??
Jul 17 '05 #1
1 4069
>db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & dbLoc & ";"
Run-time error '-2147024769(800700f)':

Method 'Open' of object' _Connection' failed
A quick search of the web comes up with the following link:
http://www.utteraccess.com/forums/ac...ess602167.html
This basically suggests re-install Access, and might be linked to Access 2003
Pro. However, the forum has not been posted to for about a week, so this is as
much information as I could find.

From another newsgroup, Mike Chaple gave the following advice:
Well I have experienced those problems. Try the following:

Open you VB application, Click on Project, References, uncheck the object
that you feel could be the problem, click OK, save your project. Click on
Project, References one more time and check back the one that you
previously uncheck, Browse to the DLL (Object) to find it with the right
Path. Save and Make your project.

Hope it help

Regards

Mike Chaple
The reply was found in microsoft.public.vb.winapi under the subject line of
"Runtime error 'automation error'".

I was using ADO 2.6 but upgraded the first time this error reared its
ugly head. That did not fix the problem.

Of course, Microsoft's site is of NO help. I found a few references
here & there on the 'net, but nothing specific to this problem, nor a
cure.

Microsoft was my first port of call, and I couldn't find anything either. Google
is better as you get the complete scenario and even a working solution (mostly).

Hope this helps.
--
QuickHare
QuickHare @ Hotmail. com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the...
1
by: Tim Shih | last post by:
Hi, I am encountering a really subtle error which I have been trying to isolate for a while and I am still not able to find it. The problem boils down to this: I have a button which marshals two...
1
by: shalin | last post by:
I am having a strange problem in my ASP.NET application. When multiple users access the web site, the changes done by a user gets reflected in another users session. I have some global...
3
by: bss2004 | last post by:
Help! I'm posting a PDF Doc to a remote server using WebClient UploadData and the following code. The DOC posts fine and the server returns a positive response. If I access the remote file in...
0
by: Daniel Crespo | last post by:
Hi to all, I'm using adodb for accessing mysql and postgres. My problem relies on the mysql access. Sometimes, when I try to execute a query (using ExecTrans method below), I get this error:...
2
by: WisTex | last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even...
5
by: genc_ymeri | last post by:
Hi over there, We are a team of 6 developping web applications (ASP.Net/C#/VB.Net/SQLServer). What happens is that randomly, each of us get the below error in (PS). We believe that the "acess is...
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
5
Ganon11
by: Ganon11 | last post by:
I usually access the community from 1 of 2 places - my classes at school, and my family computer at home. For some reason, when I access it here at school, I cannot get recent C++ posts. It still...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.