Hi there.
Using Visual Basic 6.0 and an Access database.
In the past I wrote a database program that used ADO. Whenever I needed a whole bunch of data, I'd use a statement like this:
SELECT * FROM Table WHERE Variable = Condition
Of course, if there was more than one recordset that met the above condition, I'd get all of the recordsets.
Here is my problem:
Using Visual Basic 6.0 and an Access database.
In the past I wrote a database program that used ADO. Whenever I needed a whole bunch of data, I'd use a statement like this:
SELECT * FROM Table WHERE Variable = Condition
Of course, if there was more than one recordset that met the above condition, I'd get all of the recordsets.
Here is my problem:
Code:
SQL = "Select * from Cards Where EEPROMCAMID = '" & CAMID & "'"
Set SubDB = OpenDatabase(App.Path & "\satsubs.mdb")
Set rs = SubDB.OpenRecordset(SQL)
Now, the above statement should return 3 records, because I have 3 records in which EEPROMCAMID is equal to the CAMID variable. However, it's only returning the first recordset.
I've tried doing many things, tested with different data and in different tables, and it still does the same thing (only returns the first recordset, rather than all that match). The only way I could get it to return all of the data was to just select the entire table. That isn't how I need this to work.
I don't understand why my old program works correctly and my new one refuses to work. Some different in DAO and ADO? Maybe I'm missing a command in the connection to the DB?
I'm pulling my hair out here!
Thanks to anyone who has any ideas/solutions.
--