It is important to note that you should (reads must) have the JET4 database engine installed on the target
The key lies in 2 differences from standard ADO Connections
- The use of a path as a database source and a file as a table name in ADO
Set myConn = New
myConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path
& ";Mode=Share Deny None;Extended Properties=TEXT"
Dim MyRs As New ADODB.Recordset
Set MyRs = New ADODB.Recordset
MyRs.CursorType = adOpenStatic
MyRs.LockType = adLockReadOnly
MyRs.CacheSize = 65000 ' (read up to 65000 records into RAM to avoid hard disk I/O
MyRs.Open "select * from mysummaryfile.txt", myConn,
, , adCmdText
- The use of a file called schema.ini to determine the structure of the data in the file (pseudotable)
Normally this file is created and defined with the ODBC connection tool.
Col1=Mycolumn1 Char Width 72
Col2=Mycolumn2 Char Width 70
Note: The file must be located in the same path as the file/pseudotable.