07-25-2008, 10:33 PM
Dear Siri,
This is the Code...Hope it works out for you..
I tested my version on my PC By using different table...
Let me know the result....
This is the Code...Hope it works out for you..
I tested my version on my PC By using different table...
Let me know the result....
Code:
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = ("DSN=devmitg;username=xxx;password=yyy;")
Conn.Open
Set rs = Conn.Execute("Select Code, Meaning From TB_AMS052_Codes Where Code_Nam = 'Pole' ")
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.MoveNext
loop until rs.EOF
Conn.close
Set Conn = Nothing
Set Rs = Nothing