poolhall
Active Member
- Joined
- Jan 9, 2009
- Messages
- 350
I'm using ODBC driver v.5.1, Excel 2007, Windows Vista 64bit.
I use this subroutine to retrieve some data from a remote MySQL server:
This sub retrieves data but it appears truncated. This is an example of what query produces when retrieved by this sub:
and this is actual data retrieved from PhpMyAdmin:
Actually, there is a bunch of "< br />" in there, but this forum treats them as line breaks even in the CODE tags.
Why does the data appears truncated? Is this a ODBC driver problem or Excel's fauld or it's me doing something wrong?
I use this subroutine to retrieve some data from a remote MySQL server:
Code:
Sub ADOExcelSQLServer()
Dim Cn As ADODB.Connection
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
SQLStr = "SELECT poster_name, body FROM `smf_messages` WHERE `id_topic` =14322"
Set Cn = New ADODB.Connection
Cn.Open "Driver={MySQL ODBC 5.1 Driver};Server=cracked.no;Port=3306;charset=CP1250;Database=smf_forum;User=user;Password=userpass;Option=3;"
rs.Open SQLStr, Cn, adOpenStatic
With Worksheets("Sheet1").Range("A1")
.ClearContents
.CopyFromRecordset rs
End With
rs.Close
Set rs = Nothing
Cn.Close
Set Cn = Nothing
End Sub
This sub retrieves data but it appears truncated. This is an example of what query produces when retrieved by this sub:
Code:
M0ntY 1,Arthur Abraham = 1.16,400<br />3,Under 8.5 = 1.36,100<br />
Америка [hide]2,Mike Alvarado = 1.11, 500<br />5,Victor Ortiz = 1.22,
M0ntY [hide]12,Misha Tyson = 1.06, 500<br />13,Over 5.5, 100[/hide]
and this is actual data retrieved from PhpMyAdmin:
Code:
M0ntY 1,Arthur Abraham = 1.16,400<br />3,Under 8.5 = 1.36,100<br />8,Bradley Pryce = 1.15,200
Америка [hide]2,Mike Alvarado = 1.11, 500<br />5,Victor Ortiz = 1.22, 600<br />7,Over 9.5 = 2.2, 300<br />[/hide]
M0ntY [hide]12,Misha Tyson = 1.06, 500<br />13,Over 5.5, 100[/hide]
Actually, there is a bunch of "< br />" in there, but this forum treats them as line breaks even in the CODE tags.
Why does the data appears truncated? Is this a ODBC driver problem or Excel's fauld or it's me doing something wrong?