Solved

VB crashes when performing COUNT query.

Posted on 1997-09-01
8
194 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

615 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