Text import works in Access but not in code - parameters issue?

R

Radu Stanciu

Hi,

I'm having a strange issue with importing a csv file into an access
database. This is the query I'm using:

SELECT * FROM [Text;DATABASE=D:\test].[file.txt]

And more complete, it's CREATE VIEW My_View AS SELECT * FROM
[Text;DATABASE=D:\test].[file.txt], but let's stick to the select for now.

When I run that query from access, it works ok, all the fields are
imported just right. When I'm using Delphi to run it (tried both ADO 2.7
and 2.8 versions), it gives me the following error: "Parameter object is
improperly defined. Inconsistent or incomplete information was
provided". I also made a schema.ini file which takes care of all the
formatting options, and I know it's ok since it works from access.

Why do I get that error when running it from code? Any ideas? Also, as a
side question, any idea why can't I use CREATE VIEW in a query from
inside access? It keeps bugging me about the CREATE TABLE syntax,
although I'm using CREATE VIEW.

Thanks,

Radu Stanciu
 
R

Radu Stanciu

Hmm, nevermind, I managed to fix this by running the query directly from
the ADO connection rather than a query or command object. Strange that
it doesn't work from those though...

Radu
 

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