Board index » delphi » insert into error with Access table

insert into error with Access table


2004-02-03 11:07:02 AM
delphi263
Hi All,
I am trying to insert a new record into an Access table using ADODataset.
The following code will actually get the new record/values added, but
generating an error message
"Current provider does not support returning multiple recordsets from a
single execution"
procedure TForm1.Button2Click(Sender: TObject);
begin
with ADODataSet1 do
begin
Close;
CommandText := 'insert into ProblemSeverity (Severity,Description)
values(6,"Easy")';
Open;
end;
end;
There are only three fields in the table, ID (auto number), Severity
(number), and description (text). I tried both Client Cursor and Server
Cursor locations, and still have the same problem.
Any help is appreciated.
Bud
 
 

Re:insert into error with Access table

You can not open it. Insert doesn't return any result. You need to ExecSQL it.
George Christoforakis.
"Bud" <XXXX@XXXXX.COM>writes
Quote
Hi All,

I am trying to insert a new record into an Access table using ADODataset.
The following code will actually get the new record/values added, but
generating an error message

"Current provider does not support returning multiple recordsets from a
single execution"

procedure TForm1.Button2Click(Sender: TObject);
begin
with ADODataSet1 do
begin
Close;
CommandText := 'insert into ProblemSeverity (Severity,Description)
values(6,"Easy")';
Open;
end;
end;

There are only three fields in the table, ID (auto number), Severity
(number), and description (text). I tried both Client Cursor and Server
Cursor locations, and still have the same problem.

Any help is appreciated.

Bud


 

Re:insert into error with Access table

Thanks.
Bud
"George Christoforakis" <XXXX@XXXXX.COM>writes
Quote
You can not open it. Insert doesn't return any result. You need to ExecSQL
it.
George Christoforakis.

"Bud" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Hi All,
>
>I am trying to insert a new record into an Access table using
ADODataset.
>The following code will actually get the new record/values added, but
>generating an error message
>
>"Current provider does not support returning multiple recordsets from a
>single execution"
>
>procedure TForm1.Button2Click(Sender: TObject);
>begin
>with ADODataSet1 do
>begin
>Close;
>CommandText := 'insert into ProblemSeverity (Severity,Description)
>values(6,"Easy")';
>Open;
>end;
>end;
>
>There are only three fields in the table, ID (auto number), Severity
>(number), and description (text). I tried both Client Cursor and Server
>Cursor locations, and still have the same problem.
>
>Any help is appreciated.
>
>Bud
>
>