0
votes

I am attempting to replace a InterBase DB with a MS Access DB as a test, I am connect to the MS Access DB using the TADOConnection component successfully; however when I try to connect to a table using the TADODataset, I am able to set the Connection property to the TADOConnection component but when I want to set the CommandText property I receive the following error:

Error message

The connectionstring is as follows: Provider=ADsDSOObject;User ID=admin;Encrypt Password=False;Data Source=C:\StudyTime\StudyTime.accdb;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648;

Can someone please assist me?

1
can you show us some code ? And table scheme of the table in interbase and in ms access ? - GuidoG
And why do you want to move from a client/server database to a desktop database ? Sounds like a big step back to me. - GuidoG
No code is used for this process of connection, I know what you mean by taking a step back. I wrote this program to help me keep track of my study time and I want to share it with my fellow students who do not have access to InterBase server. Using a MS access DB seems like the logical solution. The table scheme is very simple. There are 2 columns, Subject_ID data type AutoNumber and Subject data type Text. The primary key has been set to Subject_ID. - Cliff Crerar
Try to use for test an TADOQuery or TADOTable. Same error? Another? No error? - Germán Estévez -Neftalí-
Can you show us your connectionstring that you use in the connection component ? And what do you see when you click on Details in the errorform ? - GuidoG

1 Answers

2
votes

You are using a wrong provider: ADsDSOObject for ms-access.

Use Provider=Microsoft.Jet.OLEDB.4.0 or Provider=Microsoft.ACE.OLEDB.12.0; instead.

e.g.

MdbFileName := 'C:\StudyTime\StudyTime.accdb';
ADOConnection1.ConnectionString := Format('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;', [MdbFileName]);
ADOConnection1.Open;