Hello there,
I have used ADO often to fetch Data from SQL Server and .xlsx Workbooks, but I can't seem to figure out what the problem with my connection string is here.
Error message : 'C:\Users\Firstname.Lastname\Desktop\temp.csv' is not a valid Path
I have used ADO often to fetch Data from SQL Server and .xlsx Workbooks, but I can't seem to figure out what the problem with my connection string is here.
Error message : 'C:\Users\Firstname.Lastname\Desktop\temp.csv' is not a valid Path
VBA Code:
Sub test()
Dim myConn As New ADODB.Connection
Dim recSet As New ADODB.Recordset
Dim myPath As String
Dim connStrng As String
Dim qryStrng As String
Dim ReiterName As String
myPath = "C:\Users\Firstname.Lastname\Desktop\temp.csv"
connStrng = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & myPath & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
Debug.Print connStrng
myConn.Open connStrng '<--- Errror