Home All Groups Group Topic Archive Search About

Is it possible to include SELECT in Access OleDbCommand - Update?

Author
18 Mar 2006 5:16 PM
MilanB
Hello,

Is it possible to include Select statement after Update statement in
OleDbDataAdapter - UpdateCommand, like it is possible in SQL Server
For Example

UPDATE    myUnit
SET              InstitutionID = @InstitutionID
WHERE     (f_UnitID = @Original_f_UnitID) AND (InstitutionID =
@Original_InstitutionID);

                          SELECT     f_UnitID, InstitutionID
                           FROM         myUnit
                           WHERE     (f_UnitID = @f_UnitID)


If not, how to retreive in correct way For example, value of AutoIncrement
field?

Thanks
Milan

Author
18 Mar 2006 6:01 PM
Kerry Moorman
MilanB,

No, you cannot include a Select after an Update in Access.

You can use "Select @@IDENTITY" with Access to retrieve the auto-generated
primary key.

Kerry Moorman


Show quote
"MilanB" wrote:

> Hello,
>
> Is it possible to include Select statement after Update statement in
> OleDbDataAdapter - UpdateCommand, like it is possible in SQL Server
> For Example
>
> UPDATE    myUnit
> SET              InstitutionID = @InstitutionID
> WHERE     (f_UnitID = @Original_f_UnitID) AND (InstitutionID =
> @Original_InstitutionID);
>
>                           SELECT     f_UnitID, InstitutionID
>                            FROM         myUnit
>                            WHERE     (f_UnitID = @f_UnitID)
>  
>
> If not, how to retreive in correct way For example, value of AutoIncrement
> field?
>
> Thanks
> Milan

AddThis Social Bookmark Button