Hi guys!
I don't manage to figure it out a "no value given for one or more required parameters" error on this code:
Can someone help me with the correct syntax?
NB: if I use * instead of "F1 as Col1" it works well but tbh I would have liked to have something like "F1 as Col1, F2 as Col2,..."
Cheers,
Adrian
I don't manage to figure it out a "no value given for one or more required parameters" error on this code:
VBA Code:
Const INPUT_PATH As String = "C:\Input\"
Dim ConnTXT As New ADODB.Connection
Dim QryTxtRec As New ADODB.Recordset
ConnTXT.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & INPUT_PATH & ";Extended Properties='text;HDR=NO;IMEX=1;FMT=Fixed'"
'-----
QryTxtRec.Open "SELECT F1 as Col1 FROM FILE1.txt", ConnTXT, adOpenStatic, adLockReadOnly, adCmdText
'-----
With ThisWorkbook.Sheets(1)
.Cells.ClearContents
'-----
.Range("A2").CopyFromRecordset QryTxtRec
End With
Can someone help me with the correct syntax?
NB: if I use * instead of "F1 as Col1" it works well but tbh I would have liked to have something like "F1 as Col1, F2 as Col2,..."
Cheers,
Adrian