ADO Recordset Data Limit

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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top