Converting a delimited text file to .mdb format

Converting a delimited text file to .mdb format

Post by Glenn J. Schwora » Thu, 12 Jun 1997 04:00:00



I have read the documents and help files in VB and still can't get this
one to work properly.

I am trying to read in a text file (several actually) and convert them
into .mdb format data files.

The files all have headers with the field names and are delimited by a
pipe character "|" between each field.

I keep getting an error that reads something like ("filename" is an
invalid file name) each time I try to open the text file. Or if I don't
use a custom schema.ini file then I get one larg field with all of the
fields including the delimiter because the Jet DBengine doesn't know what
the delimiter is.

Anyone have a short and simple way to read in every record from a text
file delimited in this manner and write out to a .mdb table with the same
fields?

I would really appreciate the help. This is really getting to me.

 
 
 

Converting a delimited text file to .mdb format

Post by Glenn Miyashi » Fri, 13 Jun 1997 04:00:00


The INPUT Statement in VB reads text files that are comma delimited.
Furthurmore, if the the field is a String, then it must be enclosed in
double quotes (Strings can have commas in them but not double quotes).

I suggest 2 things you can do: 1) Use a Word Processor to edit the
text file or 2) Read the entire line in to VB and separate the fields
with code.


Quote:>I have read the documents and help files in VB and still can't get this
>one to work properly.
>I am trying to read in a text file (several actually) and convert them
>into .mdb format data files.
>The files all have headers with the field names and are delimited by a
>pipe character "|" between each field.
>I keep getting an error that reads something like ("filename" is an
>invalid file name) each time I try to open the text file. Or if I don't
>use a custom schema.ini file then I get one larg field with all of the
>fields including the delimiter because the Jet DBengine doesn't know what
>the delimiter is.
>Anyone have a short and simple way to read in every record from a text
>file delimited in this manner and write out to a .mdb table with the same
>fields?
>I would really appreciate the help. This is really getting to me.


 
 
 

Converting a delimited text file to .mdb format

Post by Dave Mathi » Sun, 15 Jun 1997 04:00:00



Quote:

> Anyone have a short and simple way to read in every record from a text
> file delimited in this manner and write out to a .mdb table with the same
> fields?

Look up SCHEMA.INI in your VB help file, thats how Access 95, VB4 (16 and
32bit) get round it, once the Schema.INI file is setup, you can open it
as another database (ISAM type TEXT), then use the normal DAO commands on
the text file.

Note the SCHEMA.INI needs to be in the same directory as the text file.

I would post some code, but I left it at work.
--
Dave Mathias


 
 
 

1. Convert fixed-length text file to delimited text

Hi,
I have a table with almost 600 columns & a fixed-width text file.
I tried to import data from that text file to sql server table with Import Wizard,
but it only supports first 20 columns.
Is there any way I can convert fixed-width text to delimited text?

I'm using Microsoft SQL Server 2000.
Thank you in advance

Hyung Rhoe

2. Q: TDBGrid problems with non-unique indices

3. Sync an MDB table with a DBF or Delimited Text File

4. What's happen when i add user

5. MSComm Delimited text file into .MDB

6. SQL server, IIS and firewall

7. How to import a tab delimited text file into my Access MDB

8. Win Jbase & Telnet

9. converting delimited text file to dbf

10. Programmically distinguish delimited and sdf text file format??

11. Convert Recordset to comma delimited text file in VB4

12. Converting MDB Format Files to ASCII

13. Converting text file to .mdb