Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The following code was working fine

Status
Not open for further replies.

dburnham

Programmer
Oct 18, 2001
118
US
The following code was working fine until I installed the application on the users machine. I changed the provider info to ref Jet 4.0 and nothing else that I know of. I have the same code working in the same application only looking at a different table. It works fine. I have tried to do a line by line comparison but nothing sticks out. Can someone tell me what I am missing?

The error message that I receive is Run-time erroe '-2147467259(80004005)':
Methos 'Open' of object'_Recordse' failed

The debug points to adoPrimaryRS.Open ....

The code is as follows:

**************************
Private Sub Form_Load()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Quality\EmployeeInfo.mdb;"

Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select ErrorDate, IDNUM, ErrorType, ErrorQuantity, External, TR, Comments, ErrorMonth, ErrorYear from ErrorInfo Order by ErrorDate ", db, adOpenStatic, adLockOptimistic

Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Dim oCheck As CheckBox
'Bind the check boxes to the data provider
For Each oCheck In Me.chkFields
Set oCheck.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub
*******************
Any and all help is appreciated

David
 
Do you have the ADO reference turned on?
Click "Project" menu item, then "References"

Is "Microsoft ActiveX Data objects 2.x Library" checked?? DougP, MCP
 
Yes, I have the Microsoft Active X Objects 2.0 Library checked.
 
The fact the "open" method failed suggests a couple of possibilities:

1) Is the database in the proper directory and spelled correctly? Are the column names the same?

2) Does the target machine have the proper Data Engine installed?

3) I notcie that no user id or password is specified in the connection string. Are these necessary in this case?

4) Does some other application have that database opened exclusively?


Good Luck
 
All of the items above check out OK. What I did find is that if I change the Provider back to Jet.OLEDB.3.51 the code works fine on the development machine. What confuses me is that the rest of the forms/code has Jet 4.0 as the provider..???

Any ideas

David
 
The other PC's probably have the newest MDAC isntalled try downloading and installing from Microsoft. Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
How can I tell which MDAC version each machine is operating from?

David
 
There is an EXE offered by Microsoft that will tell you, but what you could do is go onto \Control Panel \ Data Sources (ODBC) \ Drivers Tab. The newest MDAC for Access is 4.00.5303.01 Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
Why would the Jet.4.0 work on one table and not another? Both tables are from the same DB.

I even copied the Provider line from the form that works into the form that does not work. There was no change.

I also updated a target machine with MDCA6.1. This produced no change.

Help...I'm quickly going bald.

David
 
I thought your difficulty was on different PC's sorry that may ahve been from a post in MS ACcess. Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
CraigSander, You were correct. The original issues was on two machines. I discovered that the code no longer worked on my machine after I tried the install for a user.

It was also at that time that I noticed that I had both Jet.4.0 and Jet.3.51 working inside the same application.

The modules that are using 4.0 work on both machines, however, when I updated the code from the beginning of this post to also show Jet.4.0 this code would not work on either machine.


CajunCenturion,
the files were joined with in access. I have now removed the join within access. Still no change.

??
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top