about the currentrecord() [message #54865] |
Mon, 16 July 2007 21:23 |
wlz
Messages: 3 Registered: June 2007
|
Junior Member |
|
|
I want to use IDL open a MS Access database,I have connect the
database successly and create a recoreset objec,but when I read the
record value using the getrecord(),a mistake returned.so I print the
current record number and found it equal -1.
And then i query the property of the database and found the
USE_CURSOR_LIB =0.
Who can tell me why I can't read the record value.
thank you very much!
PRO Soil_database
oDB=obj_new('IDLdbDatabase')
db_list=odb->getdatasources()
index=where(STRUPCASE(db_list.datasource[*]) eq 'WISE')
datasource=db_list[index].datasource
oDB->connect,datasource=datasource
tables=odb->gettables()
oRS=obj_new('IDLdbRecordset',oDB,table='KEYAREA')
IF (oRS ->MoveCursor(/last) EQ 1) THEN BEGIN
s=oRS ->MoveCursor(/Next)
num_1=oRS ->CurrentRecord()
print,num_1
ENDIF
obj_destroy,oRS
obj_destroy,oDB
END
num_1 = - 1
|
|
|