Query text too long
I fathom that the 255 limit depends on your database and your database
driver.
I use ODBC with DB2 and execute queries having over 3,000 characters.
All the time. No problems.
As to getting field names:
Dim rs As ADODB.Recordset
Set rs = command.Execute
Dim field As ADODB.field
Dim fieldIndex As Integer
fieldIndex = 1
For Each field In rs.Fields
sheet.Cells(1, fieldIndex).Value = field.Name
fieldIndex = fieldIndex + 1
Next field
|