|
Re: How to use IDL to call SQL_Server_2008 database [message #86532 is a reply to message #86514] |
Sat, 16 November 2013 06:32  |
skymaxwell@gmail.com
Messages: 127 Registered: January 2007
|
Senior Member |
|
|
To do connection to database
1. You must have licenced IDL dataminer module.
2. Also you need property ODBC drivers, if you work under OS Windows (IP source, ports of database server etc).
3. Then, you need create couple objects - IDLdbDatabase and IDLdbRecordset classes
Here is some kind of the prototype without a lot of details. You must read IDL help for IDL dataminer module. it's become more clear then
...
objDB=OBJ_NEW('IDLdbDatabase')
datasrc='YourODBC'
sql='SELECT * FROM tablename'
;connection to database
objDB->Connect,DATASOURCE=datasrc
objRS=OBJ_NEW('IDLdbRecordset',objDB,SQL=sql)
;need correct work with cursor
result=objRS->MoveCursor(/LAST)
...
Hope it will usefull
|
|
|