Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB crashes when performing COUNT query.

Posted on 1997-09-01
8
Medium Priority
?
196 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

963 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