Hello ;
Here a exemple how using ODBC to connect to Orale database and execute and get the results:
Const adOpenStatic = 3
This is the second part of the previeus script:
Remarke : Befor you can use this you have to install oracle ODBC client 10.2 for exemple if oracle database is 10.2 and less
Here a exemple how using ODBC to connect to Orale database and execute and get the results:
Const adOpenStatic = 3
Code:
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DRIVER={Microsoft ODBC for Oracle};Server=" & sG_Database & ";UID=" & sG_DBUser & ";PWD=" & sG_DBPwd
objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic[hr]
Code:
ObjRecordset.Source="Select column from Table " ' Exemple of Query'
ObjRecordset.ActiveConnection=ObjConnection
ObjRecordset.Open
If ObjRecordset.recordcount>0 then
i = 1
Do Until ( i > iRowId Or ObjRecordset.EOF )
DataTable("Col" , dtGlobalSheet) = ObjRecordset("Column").Value
DataTable.SetCurrentRow (i)
ObjRecordset.MoveNext
i = i+1
Loop
End if