GandalfTheWhite
New Member
- Joined
- Jul 24, 2009
- Messages
- 37
I'm using ADO to access a table in Excel and return data based on criteria, any data greater than 255 chars is simply cut at this point. Is there something I can include or use to get it to return the data (at least to the 1024 char limit). My code is below
Thanks in advance.
GTW
Set cnnDD = New ADODB.Connection
cnnDD.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source=" & locat & ActiveWorkbook.Name & ";" & "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;"";"
strqry = "Select * FROM UpdatesRng" & " " & "WHERE [Ref] =" & "'" & IncidentN & "'"
Set rsExcel = New ADODB.Recordset
rsExcel.Open strqry, cnnDD, adOpenStatic, adLockOptimistic
With rsExcel
.MoveFirst
If Not (.BOF And Not .EOF) Then
Do While Not rsExcel.EOF
Worksheets("IncidentViewer").Cells(rownum, 2).Value = .Fields(1)
Worksheets("IncidentViewer").Cells(rownum, 4).Value = .Fields(2)
rownum = rownum + 1
.MoveNext
Loop
End If
End With
rsExcel.Close
Set rsExcel = Nothing
Set cnnDD = Nothing
Thanks in advance.
GTW
Set cnnDD = New ADODB.Connection
cnnDD.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source=" & locat & ActiveWorkbook.Name & ";" & "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;"";"
strqry = "Select * FROM UpdatesRng" & " " & "WHERE [Ref] =" & "'" & IncidentN & "'"
Set rsExcel = New ADODB.Recordset
rsExcel.Open strqry, cnnDD, adOpenStatic, adLockOptimistic
With rsExcel
.MoveFirst
If Not (.BOF And Not .EOF) Then
Do While Not rsExcel.EOF
Worksheets("IncidentViewer").Cells(rownum, 2).Value = .Fields(1)
Worksheets("IncidentViewer").Cells(rownum, 4).Value = .Fields(2)
rownum = rownum + 1
.MoveNext
Loop
End If
End With
rsExcel.Close
Set rsExcel = Nothing
Set cnnDD = Nothing