• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Error #510, then error #1004

I have an application that works perfectly on hundreds of PCs running XP or Vista.  We installed on a client;s computer with Vista Business and Micrsoft Office 2007 installed.  Now, when my app gets to a point in the code where it creates a recordset (using DAO) it crashes,  First I get error #510, then click OK, then get error #1004.

The line of code is something like:
sql = "select * from table1 where id = 6"
set rs = db.openrecordset(sql,dbopendynaset)

The strange thing is, it seems that the where clause is what it doesn't like.  Without the where clause I don;t get an error.  For example, if I write:

set rs=db.openrecordset("table1",dbopenrecordset)

I don't get an error.

I've tried changing the DAO360.DLL file to different versions, but that doesn't seem to solve the problem.

Any ideas?
0
murray44
Asked:
murray44
  • 3
  • 3
1 Solution
 
aikimarkCommented:
I suspect there are more errors below the surface.  
Enable error trapping (On Error Resume Next), check for Err <> 0, and then look at the ERRORS collection.

Also, I suspect that you will need to prefix the data types of your database objects with "DAO."
Example:
Dim db As DAO.Database
Dim rs As DAO.Recordset
0
 
murray44Author Commented:
We have declared the variables as you suggest

If we put "on error resume next", it will skip over any errors which might occur!
0
 
aikimarkCommented:
it traps the errors, allowing you to delve deeper into the potential causes such as examining the ERRORS collection.
0
Technology Partners: 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!

 
murray44Author Commented:
Hmmm, sorry to sound dumb here, but I'm not that familiar with the .NET environment.  I;m more of a VB6 guy still, unfortunately.

But I did do a small program with VB.NET to try to reproduce the error.  So I could ty out your suggestion there, if I knew how to access this errors collection of which you speak.

I don;t know if I mentioned this, but this error is hard to recreate - it occurs only on a particular client's machine, who;s running Vista Business ed., with Office 2007 and a few other programs installed.

Thanks for your help on this
0
 
aikimarkCommented:
None of my comments relates to the VB.Net environment.  I'm strictly commenting in the VB/VBA perspective on this question.
0
 
murray44Author Commented:
I found a solution, thanks.

It appears the msjet40.dll file was out of sybch on the target machine.  I replaced it and registered it and that solved it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now