K
KK
Hi,
Can anybody help me to overcome this problem?
ADODB is not allowing me to copy more than 255 characters into an excel
cell. I must truncate the string to 255 characters before updating.
otherwise it is throwing exception and fails. Please check the code
below. Some times the string length is more than 255 characters.
Thannks.
XLSConn = New ADODB.Connection
XLSConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDestination & _
";Extended Properties=""Excel 8.0;HDR=NO;""")
Dim source As String
Dim arrData
Dim Counter As Integer
source = "Select * from [" & sheetName & "$" & strRecRange &
"]"
XLSrs.Open(source, XLSConn, 1, 3)
arrData = Split(strRec, Chr(9))
For Counter = LBound(arrData) To UBound(arrData) - 1
XLSrs.Fields(Counter).Value = Left(arrData(Counter),
255)
Next
XLSrs.Update()
XLSrs.Close()
Can anybody help me to overcome this problem?
ADODB is not allowing me to copy more than 255 characters into an excel
cell. I must truncate the string to 255 characters before updating.
otherwise it is throwing exception and fails. Please check the code
below. Some times the string length is more than 255 characters.
Thannks.
XLSConn = New ADODB.Connection
XLSConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDestination & _
";Extended Properties=""Excel 8.0;HDR=NO;""")
Dim source As String
Dim arrData
Dim Counter As Integer
source = "Select * from [" & sheetName & "$" & strRecRange &
"]"
XLSrs.Open(source, XLSConn, 1, 3)
arrData = Split(strRec, Chr(9))
For Counter = LBound(arrData) To UBound(arrData) - 1
XLSrs.Fields(Counter).Value = Left(arrData(Counter),
255)
Next
XLSrs.Update()
XLSrs.Close()