Article ID: 187670 - View products that this article applies to.
This article was previously published under Q187670
RDO may be used with the ODBC Text driver to open and browse a delimited text file.
The Text ODBC driver relies on the Microsoft Jet 32-bit IISAM driver (MSText35.dll) that provides the services required for accessing text files. You can either link/attach to a Microsoft Access database or directly open text files. Because RDO must use Jet to access the text file, you will incur the additional overhead associated with loading Jet.
NOTE: This requires a Schema.ini file in the same path as the delimited text file. You must change the columns in the Schema.ini file to correspond to your delimited file. Also, you must change the path in the connect string to the correct path for your file.
To create a schema.ini file, use a simple text editor such as Notepad. Below are the schema.ini entries for the SAMPLE2.TXT file listed at the bottom of this article:
For more information on Schema.ini, see the REFERENCES section of this article.
You could copy and paste the following delimited file example into Notepad and save it as Sample2.txt. You could then modify the DBQ path, above, to point to the comma delimited file Sample2.txt.
1,Chai,10 boxes x 20 bags,$18.00,False
2,Chang,24 - 12 oz bottles,$19.00,False
3,Aniseed Syrup,12 - 550 ml bottles,$10.00,False
4,Chef Anton's Cajun Seasoning,48 - 6 oz jars,$22.00,False
5,Chef Anton's Gumbo Mix,36 boxes,$21.35,True
6,Grandma's Boysenberry Spread,12 - 8 oz jars,$25.00,False
7,Uncle Bob's Organic Dried Pears,12 - 1 lb pkgs.,$30.00,False
(This will give you seven records to test with in the sample code.)
NOTE: Make sure when you paste it in Notepad that you do not leave any blank lines at the top of the file.
You may choose an alternative to the comma delimiter by indicating the delimiter in the Schema.ini file e.g. Format = Delimited(*). You can use any character for the delimiter except the double (") quotation mark.
This same technique can be applied to fixed-width files by indicating 'FixedLength' for the Format, such as Format = FixedLength.
"Working with Text Files", MSDN
"Using DAO to Connect to ODBC Data Sources", MSDN.
"RDO Compared to Microsoft Jet/DAO", MSDN.
"Text Data Source Initialization Settings", MSDN.
"External ISAM Driver Components", MSDN.
"Understanding Schema.ini Files", MSDN.
For additional information, please see the following article in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/155512/EN-US/ ): ACC: How to Create a Schema.ini File Programmatically.
Article ID: 187670 - Last Review: July 13, 2004 - Revision: 1.2