Data Access Error in VB6/Access 97

B

BGardner

When launching a VB6 application that uses an access 97
database, I get a "Data Access Error" and two of three
fields do not refresh from the database. So I know that
the program has the databse, but I cannot find the cause
of the error. Any advice is appreciated.
 
T

TC

BGardner said:
When launching a VB6 application that uses an access 97
database, I get a "Data Access Error" and two of three
fields do not refresh from the database. So I know that
the program has the databse, but I cannot find the cause
of the error. Any advice is appreciated.

My advice would be to provide a bit more information!

What statement does the error occur on?

What is the exact text of the error message?

What do you mean that 2 of 3 fields "do not refresh from the database"?

TC
 
B

BGardner

Ok, here's more detail. I don't have an exact statement
that the error appears on, but my best guess is during the
data access to the database on the form load. This is the
suspect code right now:

Set qdfTemp = .CreateQueryDef("", "SELECT * FROM
MotorVariables where MotorId = '" + Motor.Text + "'")

The machine is running VB executable, but does not have VB
loaded so I can't step through the code on the machine to
confirm this.

The exact error message is "Data Access Error". I receive
it twice, once for each dropdown that fails to load, then
the mainmenu form loads normally. If I click on the
refresh data button which refreshes the data to one of the
dropdowns that is giving the problem, I found that it
gives me a runtime error 525 with the same Data Access
Error message during loading. (just found this today)

Two of three fields don't update from the database
information means exactly that. There are 3 fields that
pull data from the database and create lists for pull
downs. One is working, 2 are not. They do access
different tables in the database. Here is the one that
works on this machine:

Set qdfTemp = .CreateQueryDef("", "SELECT * FROM
UserInformation where Username = '" + Operator.Text + "'")

I also have a mirror of this exact program and database on
another machine that works just fine. So I can't figure
out why it works one place and not here.
 
T

TC

Ok, here's more detail. I don't have an exact statement
that the error appears on, but my best guess is during the
data access to the database on the form load. This is the
suspect code right now:

Set qdfTemp = .CreateQueryDef("", "SELECT * FROM
MotorVariables where MotorId = '" + Motor.Text + "'")

Shouldn't you use & (not +) for string appending?

The machine is running VB executable, but does not have VB
loaded so I can't step through the code on the machine to
confirm this.

Installing VB so you could step through the code would probably be wiorth it
in terms of tracking this error.

The exact error message is "Data Access Error".

Ok. That is not an MS Jet error. I assume it is a VB error, or a custom
error from your application.
I receive
it twice, once for each dropdown that fails to load, then
the mainmenu form loads normally. If I click on the
refresh data button which refreshes the data to one of the
dropdowns that is giving the problem, I found that it
gives me a runtime error 525 with the same Data Access
Error message during loading. (just found this today)

Two of three fields don't update from the database
information means exactly that. There are 3 fields that
pull data from the database and create lists for pull
downs. One is working, 2 are not. They do access
different tables in the database. Here is the one that
works on this machine:

Set qdfTemp = .CreateQueryDef("", "SELECT * FROM
UserInformation where Username = '" + Operator.Text + "'")

I also have a mirror of this exact program and database on
another machine that works just fine. So I can't figure
out why it works one place and not here.

How is your VB program identifying the workgroup file for the database?

Are you using the same workgroup file on all those PCs?

HTH,
TC
 
B

BG

Found the fix...
Dell installs a DMI utility which has the jet35.dll in
it. Without this file, I get this error. When the PC was
set up IT didn't install since they figured it wasn't
needed so I didn't have the DLL's I needed. Registered
the file and the error goes away. Still can't figure out
why it only affects 2 fields on the form though... oh
well. Thanks for digging in TC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top