R
raj
Hello, I hope someone can help me with this issue, please.
I need to open a large semi-colon delimited text file into
a recordset using ADO.
Is this possible? If so, how do I make ADO aware that the
file is "semi-colon" delimited?
Right now, my code does not recognize this delimeter and
imports all the data into the recordset as one column
(NOTE: there are too many rows to open into a spreadsheet).
Your example code would be most appreciated, thanks in
advance.
If needed, my code so far is below:
Set cnText = New ADODB.Connection
cnText.CursorLocation = adUseClient
cnText.ConnectionString = "PROVIDER=MSDASQL;DRIVER=
{MICROSOFT TEXT DRIVER (*.TXT; *.CSV)};DBQ=" & argFilePath
& ";"
cnText.Open
strSQL = "SELECT * FROM " & argFileName & ";"
Set rsText = New ADODB.Recordset
rsText.MaxRecords = 0
rsText.Open Source:=strSQL, ActiveConnection:=cnText,
CursorType:=adOpenForwardOnly, LockType:=adLockReadOnly,
Options:=adCmdText
Your example code would be most helpful, TIA.
I need to open a large semi-colon delimited text file into
a recordset using ADO.
Is this possible? If so, how do I make ADO aware that the
file is "semi-colon" delimited?
Right now, my code does not recognize this delimeter and
imports all the data into the recordset as one column
(NOTE: there are too many rows to open into a spreadsheet).
Your example code would be most appreciated, thanks in
advance.
If needed, my code so far is below:
Set cnText = New ADODB.Connection
cnText.CursorLocation = adUseClient
cnText.ConnectionString = "PROVIDER=MSDASQL;DRIVER=
{MICROSOFT TEXT DRIVER (*.TXT; *.CSV)};DBQ=" & argFilePath
& ";"
cnText.Open
strSQL = "SELECT * FROM " & argFileName & ";"
Set rsText = New ADODB.Recordset
rsText.MaxRecords = 0
rsText.Open Source:=strSQL, ActiveConnection:=cnText,
CursorType:=adOpenForwardOnly, LockType:=adLockReadOnly,
Options:=adCmdText
Your example code would be most helpful, TIA.