VB crashe when calling parametrized query within dataEnvironment 
Author Message
 VB crashe when calling parametrized query within dataEnvironment

Hi folks

Here is my BIG problem

I'm using
    VB6 / JET OLDEB 4.0/ MS Access 97

I built a Dataenvironment  parameterized query that is supposed to return a
recordset
Let's assume that the folowing query return a recorset whith all the books
loaned to steve
the call is: DataE.Average ("Steve")  and it returns datae.rsAverage

The problem: It work fine in any case under my development environment but
crashes
under exec environment if the query returns no recordset

Thanks for any help



Sat, 05 Oct 2002 03:00:00 GMT  
 VB crashe when calling parametrized query within dataEnvironment


Quote:
> Hi folks

> Here is my BIG problem

> I'm using
>     VB6 / JET OLDEB 4.0/ MS Access 97

> I built a Dataenvironment  parameterized query that is supposed to
return a
> recordset
> Let's assume that the folowing query return a recorset whith all the
books
> loaned to steve
> the call is: DataE.Average ("Steve")  and it returns datae.rsAverage

> The problem: It work fine in any case under my development
environment but
> crashes
> under exec environment if the query returns no recordset

> Thanks for any help

If your program is crashing after returning an empty rcordset, I
suspect it is trying to do some method or activity on this empty
recordset. A solution I would look at is trapping the empty recordset
condition, and if it occurs, return the records back to all records via
SQL and exit the sub after displaying a MsgBox.
eg
If (MyRs.Recordcount < 1) Then
MsgBox "No records were returned from the Database on the selected
criteria"
'set recordset back to show all records here
Exit Sub
End If
--
dcward

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 05 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. calling Parametrized Access 2000 query

2. VB/ADO parametrized queries

3. Calling Access queries from within VB 5.0

4. Calling Access Queries Within VB.

5. Executing parametrized queries in ADODC component

6. SQLBase, ODBC and Parametrized Queries

7. Parametrized create table query

8. Parametrized SQL-queries with ODBC interface

9. Crystal and parametrized queries

10. Parametrized Query with Optional TOP Predicate

11. Parametrized Query

12. HELP: Parametrized union queries don't work with Jet 4.0

 

 
Powered by phpBB® Forum Software