0

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?

Community
  • 1
  • 1
Cliff Crerar
  • 433
  • 8
  • 24
  • 2
    can you show us some code ? And table scheme of the table in interbase and in ms access ? – GuidoG Sep 19 '16 at 13:04
  • 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 Sep 19 '16 at 13:04
  • 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 Sep 19 '16 at 13:20
  • Try to use for test an TADOQuery or TADOTable. Same error? Another? No error? – Germán Estévez -Neftalí- Sep 19 '16 at 13:44
  • 1
    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 Sep 19 '16 at 13:51
  • When I use TADOTable the error is: – Cliff Crerar Sep 19 '16 at 14:15
  • [TADOTable - error](https://1drv.ms/t/s!AnKO9VKCanhrkB95Jq2qZ_zU8_a3) – Cliff Crerar Sep 19 '16 at 14:21
  • When I use TADOQuery the error detail is: [TADOQuery - Error](https://1drv.ms/t/s!AnKO9VKCanhrkB6tMkAxJeTdhbXm) – Cliff Crerar Sep 19 '16 at 14:23
  • and how does the connectionstring in the Connection component looks like ? – GuidoG Sep 19 '16 at 14:31
  • `Provider=ADsDSOObject;User ID=admin;Encrypt Password=False;Data Source=C:\StudyTime\StudyTime.accdb;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648;` -When the connection is tested it passes the connection test – Cliff Crerar Sep 20 '16 at 08:18

1 Answers1

2

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;
kobik
  • 21,001
  • 4
  • 61
  • 121