J
Jinshui
I wrote code in a Module to retrive the data from Access 2003 in which the
tables are linked through ODBC. Before I get the data, I need to know the
total number of records. The snapet of my code is like this:
set myDB =CurrentDB
SQLString="select * from Employer"
set RecordSetDailyUpload = myDB.OpenRecordset(SQLstring, dbOpenDynaset)
RecdCounter=RecordSetDailyUpload.RecordCount
debug.print RecdCounter
RecordSetDailyUpload.MoveFirst
Do While Not RecordSetDailyUpload.EOF
EmployerName=RecordSetDailyUpload.fields(0)
debug.print EmployerName
....
.....
RecordSetDailyUpload.movenext
Loop
RecordSetDailyUpload.close
The problem is that it prints out 1 in immediate windows no matter how many
rows output. However, the while loop will go until the end of the record
sets(i.e. I can obtain many employerNames).
You are so appeciated if you could suggest any clues and solutions. Please
note the tables in database are linked tables through ODBC.
Jinshui
tables are linked through ODBC. Before I get the data, I need to know the
total number of records. The snapet of my code is like this:
set myDB =CurrentDB
SQLString="select * from Employer"
set RecordSetDailyUpload = myDB.OpenRecordset(SQLstring, dbOpenDynaset)
RecdCounter=RecordSetDailyUpload.RecordCount
debug.print RecdCounter
RecordSetDailyUpload.MoveFirst
Do While Not RecordSetDailyUpload.EOF
EmployerName=RecordSetDailyUpload.fields(0)
debug.print EmployerName
....
.....
RecordSetDailyUpload.movenext
Loop
RecordSetDailyUpload.close
The problem is that it prints out 1 in immediate windows no matter how many
rows output. However, the while loop will go until the end of the record
sets(i.e. I can obtain many employerNames).
You are so appeciated if you could suggest any clues and solutions. Please
note the tables in database are linked tables through ODBC.
Jinshui