07-28-2008, 02:33 PM
hi sridhar ,
Thanks for hte great help .
I could get the data .
into the excelsheet on to the desktop.
Thanks a lot again .
Learning a lot from this forums helping me a lot .
I need to get the row count thats it i will do it thanks again
If any quesries will post
Code I used :
Great its working
Thanks for hte great help .
I could get the data .
into the excelsheet on to the desktop.
Thanks a lot again .
Learning a lot from this forums helping me a lot .
I need to get the row count thats it i will do it thanks again
If any quesries will post
Code I used :
Great its working
Code:
'Data base connection'
Set conn=CreateObject("ADODB.Connection")
conn.Open("DRIVER={Oracle in OraHome92};SERVER=DEVMITG;UID=ITL_ASSET;PWD=ITL_ASSET;DBQ=DEVMITG")
'rs connection record set'
Set rs = CreateObject("ADODB.recordset")
' Specify the query'
sql = "Select Code, Meaning From TB_AMS052_Codes Where Code_Nam = 'Pole' "
''Execute the Query’
rs.open sql,conn
'‘Adding a column to datatable’
For each fields in rs.fields
DataTable.GlobalSheet.AddParameter fields.name , ""
Next
rs.MoveFirst
iRow = 1
Do
DataTable.SetCurrentRow iRow
DataTable("Code",dtGlobalSheet) = rs.fields("Code")
DataTable("Meaning",dtGlobalSheet) = rs.fields("Meaning")
iRow = iRow + 1
'rs.save
rs.MoveNext
loop until rs.EOF
'Get the values from the Meaning column’
While(NOT rs.EOF)
rs.MoveNext
wend
DataTable.Export "C:\Documents and Settings\501404673\Desktop\data.xls"
rs.close
conn.close