I am trying the following code and keep getting an error:
The error is Query Input Must Contain At Least One Table Or Query. Is there a way I can modify this to work? Thanks.
Swi
Code:
Dim conn As ADODB.Connection
Dim numofrecscopied As Long
Set conn = CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;Extended Properties=dBASE 5.0;User ID=;Password="
conn.Open
conn.Execute "SELECT STATE, COUNT(*) AS QUANTITY INTO [Excel 8.0;" & _
"Database=C:\TEST.XLS].[Sheet1] FROM " & _
"TEST.DBF", numofrecscopied
conn.Close
Set conn = Nothing
MsgBox numofrecscopied & " records copied to Excel!", vbInformation
The error is Query Input Must Contain At Least One Table Or Query. Is there a way I can modify this to work? Thanks.
Swi