OpenRecordSet problem

OpenRecordSet problem

Post by Roger Laflech » Mon, 03 Mar 1997 04:00:00



I have the weirdest thing, I loop through a series of items and for each I
do a select statement using  SET myvar =
DBobject.OpenRecordSet("select...", dbOpenSnapshot).  Every time I run this
procedure, the results should be the same but the problem is that sometimes
records are returned and sometimes nothing is returned.  So when nothing
was returned I went in the debug window and executed the same query, no
matter what I selected from this table I got no records so I closed the
record set and then I got some records. But this is never consistent.
The database is foxpro 2.6, I query records from one table only, I close
the recordset after I used it.
I don't get it because in this loop I also do the same query (using the
same Where clause) on another table and it always returns the same values.
I don't get this, I have spent alot of time trying to figure out what was
wrong, sometime the query works other times it doesn't  WHY???

Thanks

 
 
 

OpenRecordSet problem

Post by John Conle » Wed, 05 Mar 1997 04:00:00


Are you also doing a corresponding 'Set myvar = Nothing'? If you can
provide a little more info, perhaps I can try to help. I'd like to also
know why are you opening a recordset against the same variable in a loop
(if that's the case)?

John Conley



Quote:> I have the weirdest thing, I loop through a series of items and for each
I
> do a select statement using  SET myvar =
> DBobject.OpenRecordSet("select...", dbOpenSnapshot).  Every time I run
this
> procedure, the results should be the same but the problem is that
sometimes
> records are returned and sometimes nothing is returned.  


 
 
 

1. OpenRecordset problem

Greetings!
If somebody could help me with my problem please!

I am using Access 2000 on Win2k connected to MS SQL Server 7.0

Here is the code I am using in order to open a recordset:

 Dim mySoftware As ADODB.Recordset
      mySoftware = New ADODB.Recordset
  Set mySoftware = CurrentDb.OpenRecordset(Software)

When I do this it gives me an error (Invalid use of property and
highlights 'mySoftware' = in the second line)

When I omit using New, it will not let me do 'Set mySoftware =
CurrentDb.OpenRecordset(Software)'
___________
Set vbSoftware = New ADODB.Recordset
Set vbSoftware = CurrentDb.OpenRecordset(Software)

This gives me 'object variable not set'
____________
Set vbSoftware = CurrentDb.OpenRecordset(Software)

This string alone would give the same error.
____________

Please advise

Thanks,
Alex
..

2. ROLLFORWARD +J and disabled journals

3. OpenRecordset Problem in Access2K

4. MDX: Is it possible "union" multiple selects

5. VB4(16) & Sybase System 10 OpenRecordset problem

6. Help: Info about Intermedia Text

7. Identity column causing OpenRecordset problem.

8. firewalls & ports - connection problem

9. openrecordset problem

10. Simple OpenRecordset problem

11. OpenRecordset problems.

12. OpenRecordset problem

13. db.OpenRecordset Data Access -- Update and Edit problems