Hi all,
Working with an Access 97 database with a simple table. I have many queries that work with it, but one is raising an exception when I open it. The first bit of code shows where I set up the TADOConnection object:
And this bit is the method containing the problem
I have the last Open method trapped in a try..except block, and E.Message = '(EOleException) Unspecified error'. I've searched the web for this, and my last try was to add the [tt]Transfers.[/tt] bit before each column, but it's made no difference.
This procedure gets called way off in the middle of my service app, and I have many other queries constructed in this way on the same table - but not necessarily with the same fields or filters - and they work ok.
The table's Primary key is on the ID field. There are no other indexes. The table has about 8 records, all of which were added by my delphi program.
Any clues?
Working with an Access 97 database with a simple table. I have many queries that work with it, but one is raising an exception when I open it. The first bit of code shows where I set up the TADOConnection object:
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487
[/i][/navy]
[b]procedure[/b] TCopyBak2.ServiceStart(Sender: TService; [b]var[/b] Started: Boolean);
[b]begin[/b]
CoInitialize([b]nil[/b]);
LocalConnection.ConnectionString := Format([teal]'Provider=Microsoft.Jet.OLEDB.4.0;'[/teal]
+ [teal]'Data Source=%sCopyBak2.mdb;Persist Security Info=False'[/teal],
[ExtractFilePath(ParamStr([purple]0[/purple]))]);
LocalConnection.Open; [navy][i]// activate local database
[/i][/navy][navy][i]// snip
[/i][/navy][b]end[/b];
Code:
[b]procedure[/b] TCopyBak2.UpdateTransferPosition(AID: Integer; APos: Int64);
[b]begin[/b]
[b]with[/b] TADOQuery.Create([b]nil[/b]) [b]do[/b]
[b]try[/b]
Connection := LocalConnection;
SQL.Text := Format([teal]'SELECT Transfers.ID, Transfers.Position FROM Transfers '[/teal]
+ [teal]'WHERE (Transfers.ID)=%d'[/teal], [AID]);
Open; [navy][i]// causes exception
[/i][/navy][navy][i]// snip
[/i][/navy][b]end[/b];
I have the last Open method trapped in a try..except block, and E.Message = '(EOleException) Unspecified error'. I've searched the web for this, and my last try was to add the [tt]Transfers.[/tt] bit before each column, but it's made no difference.
This procedure gets called way off in the middle of my service app, and I have many other queries constructed in this way on the same table - but not necessarily with the same fields or filters - and they work ok.
The table's Primary key is on the ID field. There are no other indexes. The table has about 8 records, all of which were added by my delphi program.
Any clues?