Solved

VB crashes when performing COUNT query.

Posted on 1997-09-01
8
183 Views
Last Modified: 2011-10-03
Hi there,

I'm currently writing an application which allows users to search and browse a database of 300,000 records at various levels.

Prior to running the main query, a sub-query is run which will return the number of records that will be retrieved in the following query.  This works fine for most of the time but when peforming the following COUNT query the system completely crashes:

Set l_countsnap = g_db.CreateSnapshot("SELECT COUNT(*) AS ALIAS FROM CAMISPMI WHERE [SURNAME] = 'ROBERTS' AND [FORENAME1] LIKE 'J*'")

My question is this;  does anyone know how to get round this problem, or alternatively is there a fast way to retrieve the number of records that the subsequent query will return.  Using the recordcount function is not really an option as this is way too slow.

Thanks for any help

Pete

P.S. When I say the application crashes I mean I get the error message saying 'An error has occurred in your application blah blah blah!!!"

0
Comment
Question by:peterwest
  • 4
  • 4
8 Comments
 
LVL 2

Author Comment

by:peterwest
ID: 1433166
Edited text of question
0
 
LVL 1

Expert Comment

by:Jedi
ID: 1433167
What DB are you using ?

0
 
LVL 1

Expert Comment

by:Jedi
ID: 1433168
If you step through the code , is the "crash" on the create snapshot line ?
0
 
LVL 2

Author Comment

by:peterwest
ID: 1433169
Hi,

Sorry for my lack of detail; I'll try to explain in a little more detail.

Firstly, the error is being caused by the line which creates the snapshot and the module which is causing the problem is MSAJT200.DLL.  The database I'm using is in Access 2 format.

I've tried performing the same query in Access and it generates the same error message; I therefore tried it on another machine under Access and it worked fine.  I've traced the problem back to the version of MSAJT200 - could this be because I have installed the Compatability Layer???

I tried copying an older version of MSAJT200 onto my machine and now the query works under Access, but if I try it under VB it still crashes but reports the error is in MSAJT112.DLL.

Hope this clears a few things up.....

Thanks

Pete

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Expert Comment

by:Jedi
ID: 1433170
Are you using VB3 or VB4 ?

Are you developing a 16-bit application ?

0
 
LVL 2

Author Comment

by:peterwest
ID: 1433171
Hi,

I'm developing a 16-bit application using VB3.

Thanks

0
 
LVL 1

Accepted Solution

by:
Jedi earned 100 total points
ID: 1433172
It's a cruel world for VB3 and Jet Engine developers !

The Service Pack for Access 2.0 is worth trying to make sure your Jet Engine version is consistent with all dlls.

availible at Microsoft

I've been in this situation, not the same Error but a "unexplained" crash ,and the Service pack sorted it out for me.

Hope it helps

0
 
LVL 2

Author Comment

by:peterwest
ID: 1433173
Hi there,

I actually managed to resolve this problem in the end by simply re-installing the Compatability Layer.

However, I had the same problem on a second machine and tried your answer and this worked too - the points are all yours....thanks....

pete

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

20 Experts available now in Live!

Get 1:1 Help Now