A97 Import from CSV via ASP page

A

Alex NSB

Hi all.

Sorry for cross-posting, but I had no replies in comp.databases.ms-access;
hope somebody can help with this here :)

I have to import a CSV file (made by the user with Excel) into an A97 table.

This is the code I use in my ASP page (NT4.0 Server/IIS4):

sql = "INSERT INTO ImportTable SELECT * FROM [Text;Database=" & FilePath &
";HDR=" & hd & ";FMT=Delimited].[" & FileName & "]"

It works, but I have a little problem that is driving me crazy: one of the
fields is a phone number and I'm unable to preserve the leading zero.

Note that:

- all the fields in the import table are defined as text;
- the CSV does contain the leading zero;
- if I import manually in A97 (File/Get External Data) the same CSV it works
correctly.

TIA for your assistance.

Alessandro
 
D

david epsom dot com dot au

CSV is not a defined standard: every version is different.

Export the Access table as text, look for schema.ini
in the import/export folder, edit schema.ini so that the
field is defined as a text field, see if that helps.

(david)
 
A

Alex NSB

David,

thank you for your reply.
CSV is not a defined standard: every version is different.

Do you think another format would be more appropriate? What I really need is
a format that can be *easily* (using Word, Excel or other standard tools)
produced by the end user.
Export the Access table as text, look for schema.ini
in the import/export folder, edit schema.ini so that the
field is defined as a text field, see if that helps.

Forgive me, but I fail to see how this could help solve my *web import* in
Access... Where should I put this schema.ini, on my web server? Am I missing
something?

Alessandro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top