Data with Longvarchar datatype is not retreived to recordset
Hi,
I am using ADO connection to connect to database (ASA or SQL Server).
Everything was working until recently column with datatype LongVarchar was added.
Now data initially retrieved to record set but immediately is it cleared from recordset.
Can anyone let me know whats wrong in below script?
Set Conn = ADO.CreateADOCommand
Conn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=<Datasource name>"
Conn.CommandText = sQry
Set RS = Conn.Execute
Dim objExcel
Dim objWorkbook1
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook1= objExcel.Workbooks.Open(<Excel Path>)
objExcel.visible =true
Set objWorksheet1= objWorkbook1.Worksheets(<Sheet Name>)
fldCount = rs.Fields.Count
For iCol = 1 To fldCount
objWorksheet1.Cells(iRownumber, iCol).Value = rs.Fields(iCol - 1).Name
Next
objWorksheet1.Cells(iRownumber+1, 1).CopyFromRecordset RS
RS.Close
Set RS = Nothing
Set Conn = Nothing
Call objWorkbook1.Save
Call objWorkbook1.Close
Set objExcel=nothing