Any ideas?
' login to the test db and select all records, then place headers +
data into Excel...
Dim MySQLConn
Dim sqlstr As String
Dim MySQLRS
MySQLConn = CreateObject("ADODB.Connection")
MySQLConn.open = "DRIVER={MySQL ODBC 5.1
Driver};SERVER=serveraddress;DATABASE=mydata;UID=dbuser;PWD=password;OPTION=35;"
sqlstr = "SELECT Tbl.ID_no FROM Tbl WHERE Tbl.ID_no='N79938';"
MySQLRS = CreateObject("ADODB.Recordset")
MySQLRS.open(sqlstr, MySQLConn, 1, 4, 1)
Dim Excel
Excel = CreateObject("Excel.Application")
Excel.visible = True
Excel.Workbooks.Add()
Dim i
' .Cells(column, row) convention, by ADO recordset uses 0-based
versus excel's
' 1-based subscripts...
For i = 0 To MySQLRS.fields.count - 1
Excel.Workbooks(1).Worksheets(1).Cells(1, i + 1).value =
MySQLRS.fields(i).name
Next
'Excel.Workbooks(1).Worksheets(1).Range("A2").CopyFromRecordset(MySQLRS)