Importing text file using schema.ini
I'm importing a text file (which is a data extract) into a MDB database using
VB and a schema.ini file. My problem arises when I import a varchar field
(text) which contains a quote character ( " ). This throws VB off for some
reason and stops the importing of the line. It later resumes.
Is there any way to have VB change the ( " ) character to a single quote
( ' ) upon importing? We'll be doing this import process once a week and
we don't want to be going through and finding ( " )'s in the file all the
So I need somehow for the application to ignore any imported ( " )'s and
change them to ( ' )'s. Here's the SQL-ish statement we're using to import:
"SELECT * INTO [" & stTable & "] FROM [Text;DATABASE=" & stTxtPath & _
"].[" & LCase$(stTable) & ".txt]"
Uses the schema.ini file to import those fields, here's the outtake of the
relevant part of the schema.ini file:
The file is ( | ) delimited (as shown above) and it works fine except for
the lines where certain fields (like the description fields) have a ( " )
Any suggestions are greatly appreciated! Thanks in advance.
Re: Importing text file using schema.ini
On 2 Oct 2001 12:06:11 -0700, "Kevin" <firstname.lastname@example.org> wrote:
¤ I'm importing a text file (which is a data extract) into a MDB database using
¤ VB and a schema.ini file. My problem arises when I import a varchar field
¤ (text) which contains a quote character ( " ). This throws VB off for some
¤ reason and stops the importing of the line. It later resumes.
¤ Is there any way to have VB change the ( " ) character to a single quote
¤ ( ' ) upon importing? We'll be doing this import process once a week and
¤ we don't want to be going through and finding ( " )'s in the file all the
The double quote is considered a line delimiter so I'm not aware of any way around this other than
to parse them out and replace them using standard VB file operations or a text editor if you don't
need to code this part.
Paul ~~~ email@example.com
Microsoft MVP (Visual Basic)