07-24-2008, 04:47 PM
Hi Sridhar ,
Can i get ur contact nubmer so that i can briefly explain my problem
See this is the code
modified one :
'
Can i get ur contact nubmer so that i can briefly explain my problem
See this is the code
modified one :
Code:
Set Conn = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.recordset")
Conn.Open("DRIVER={Oracle in OraHome92};SERVER=DEVMITG;UID=ITL_ASSET;PWD=ITL_ASSET;DBQ=DEVMITG")
' Conn.Open("DSN=devmitg;UID=ITL_ASSET;PWD=ITL_ASSET");
' Specify the query'
sql = "Select Code, Meaning From TB_AMS052_Codes Where Code_Nam = Pole"
'Set the recordset cursor type’
Rs.CursorType = 1
'Execute the Query’
'Rs.Open sql,Conn
'Get the no records returned by query’
Recordcount = Rs.RecordCount
'Adding a column to datatable’
DataTable.GlobalSheet.AddParameter "Meaning"
'Get the values from the Meaning column’
While(NOT Rs.EOF)
Msgbox Rs.Fields("Meaning")
For i=1 to Recordcount
DataTable.SetCurrentRow(i)
'Writing the data to the datatable’
DataTable("Meaning",DtGlobalSheet) = Rs.Fields("Meaning")
Rs.MoveNext
Next
wend
'close the database connection’
DataTable.Export "C:\DatabaseExample.xls"
Conn.close
Set Conn = Nothing
Set Rs = Nothing
'