I'm using the excel driver to connect to a spreadsheet like so...
Path = "C:\EDI.xls"
Set EConnection = CreateObject("ADODB.Connection"
EConnection.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ=" & Path & ";ReadOnly=0;UID=admin;"
Set ADOCmd.ActiveConnection = EConnection
...now it appears to be connecting just fine. But, I'm not quite sure how to populate a recordset. I'm trying
ADOCmd.CommandType = adCmdUnknown
strSQL = "select * From sheet"
ADOCmd.CommandText = strSQL
Set recset = ADOCmd.Execute
But I'm getting an error in the 'From' clause message. So how do I use a SQL string with the Excel driver??
My file is called 'EDI.xls' and the Worksheet is named 'sheet' any help???
Path = "C:\EDI.xls"
Set EConnection = CreateObject("ADODB.Connection"
EConnection.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ=" & Path & ";ReadOnly=0;UID=admin;"
Set ADOCmd.ActiveConnection = EConnection
...now it appears to be connecting just fine. But, I'm not quite sure how to populate a recordset. I'm trying
ADOCmd.CommandType = adCmdUnknown
strSQL = "select * From sheet"
ADOCmd.CommandText = strSQL
Set recset = ADOCmd.Execute
But I'm getting an error in the 'From' clause message. So how do I use a SQL string with the Excel driver??
My file is called 'EDI.xls' and the Worksheet is named 'sheet' any help???