GeekBoy93
August 27th, 2001, 01:07 PM
Trying to read data from a DB2 table on a mainframe. I don't get any VB error events. The connection object is open but the record count is -1. When running the SQL in the designer I get Query Finished Successfully, but no records returned in the table viewer. Any ideas???
Thank you in advance
Cakkie
August 28th, 2001, 01:12 AM
Judging to the looks of that, I would think that the statement simply doesn't return any records. Check, and double check the statement if you are sure that you need records to be returned. Also note that some syntax may change from platform to platform. For example, MSAccess uses * as wildchar, while SQL Server uses %, I don't know what DB2 uses, but it's worth checking out.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Iouri
August 28th, 2001, 06:50 AM
Not every recordset support the recordcount property. It might be the case with DB2. Make sure that your cursor is client side (only this type of cursor support recordcount).
To check if the recordset has records you can count records using SQL
"select count(*) as RC from Table"
rs.Open SQl...
RecordCount = rs!RC
Iouri Boutchkine
iouri@hotsheet.com