Solved

VB crashes when performing COUNT query.

Posted on 1997-09-01
8
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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
 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 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