
ADO using Jet provider for text files
From Carl Prothman's site http://www.able-consulting.com/ado_conn.htm:
You can also open a Text File using the "OLE DB Provider for Microsoft Jet"
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited;"";"
' Then open a recordset based on a select on the actual file
oRs.Open "Select * From MyTextFile.txt", oConn, adOpenStatic,
adLockReadOnly, adCmdText
For more information, see: Q262537
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
Quote:
> > _bstr_t bstrConnStr( _T("PROVIDER=MSDASQL;DRIVER={Microsoft Text Driver
> > (*.txt; *.csv)};DefaultDir=") );
> > bstrConnStr += strPath;
> > bstrConnStr += _T(";DBQ=") + strPath;
> > bstrConnStr += _T(
";Extensions=333;READONLY=FALSE;FIL=text;UID=admin;");
Quote:
> > 333 - custom extension (what ever you want )
> > strPath - i think it is obvious
> > hope this will help
> But that does not use jet. It uses the MSDASQL provider. I already knew
> how to do that. The MSDASQL is the OLEDB provider for ODBC. I am looking
> for a solution that uses the Jet 4.0 provider.