By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

General SQL Error -2147221164

P: n/a
Hi all,

I'm getting the above error in Delphi 4 when attempting to connect a
TDatabase component to an MS Access table. I am following the below
instructions:

Database1.DatabaseName:='tryDB';
Database1.DriverName:=MSACCESS;
Database1.LoginPromt:=false;
Database1.Params.Clear;
Database1.Params.Add('DATABASE NAME=D:\Projects\pattern.mdb');
Database1.Connected:=true;
TDBGrid.DataSource:=DataSource1;
DataSource1.DataSet:=Table1;
Table1.DatabaseName:='tryDB';

Table1.Active:=true;

Any help would be appreciated.

TIA,

TJ

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Isn't the driver name based on the ODBC drivers in the Control Panel >
ODBC Administration dialog box? If so the driver name is

Microsoft Access Driver (*.mdb)

and not

MSACCESS

Also, and in this I'm refering to an area I have no knowledge of
(Delphi), you appear to have named the database 3 times:

1) Database1.DatabaseName:='tryDB';
2) Database1.Params.Add('DATABASE NAME=D:\Projects\pattern.mdb');
3) Table1.DatabaseName:='tryDB';

Certainly, once is enough?

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQA19aYechKqOuFEgEQJ3QgCfTQfIwtWR7heJKe2M2q8rn8 d15bkAoMbe
Y6Ie+pGJugzNEL5CUfCUqa6S
=LR4U
-----END PGP SIGNATURE-----
Timothy Jones wrote:
Hi all,

I'm getting the above error in Delphi 4 when attempting to connect a
TDatabase component to an MS Access table. I am following the below
instructions:

Database1.DatabaseName:='tryDB';
Database1.DriverName:=MSACCESS;
Database1.LoginPromt:=false;
Database1.Params.Clear;
Database1.Params.Add('DATABASE NAME=D:\Projects\pattern.mdb');
Database1.Connected:=true;
TDBGrid.DataSource:=DataSource1;
DataSource1.DataSet:=Table1;
Table1.DatabaseName:='tryDB';

Table1.Active:=true;

Any help would be appreciated.

TIA,

TJ


Nov 12 '05 #2

P: n/a
Thanks for your input. I think I have an answers to your questions.

You are correct about the ODBC driver being in the ODBC Administration
dialog box, however within Delphi there is a native driver called MSACCESS.
This is the driver that the instructions I have refer to.

On your second point about the database name, I believe the only reference
to the database itself is the Database1.Params.Add('DATABASE
NAME=D:\Projects\pattern.mdb'); where the other two are alias names.

Sorry for the confusion in my previous message, but I'm learning as much as
I can as quickly as I can and still having the same problem.

Regards,
MGFoster wrote in message ...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Isn't the driver name based on the ODBC drivers in the Control Panel >
ODBC Administration dialog box? If so the driver name is

Microsoft Access Driver (*.mdb)

and not

MSACCESS

Also, and in this I'm refering to an area I have no knowledge of
(Delphi), you appear to have named the database 3 times:

1) Database1.DatabaseName:='tryDB';
2) Database1.Params.Add('DATABASE NAME=D:\Projects\pattern.mdb');
3) Table1.DatabaseName:='tryDB';

Certainly, once is enough?

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more Microsoft Access / VBA Questions on Bytes