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