Welcome! Log In Create A New Profile

Advanced

HFCS INSERT via OLEDB

Posted by norfolk-reg 
HFCS INSERT via OLEDB
February 28, 2021 08:28PM
Good evening,

I've seen a couple of very old posts that seem to say you can't get the identity of a newly-inserted record when using an OLEDB connection to an HFCS database, but I'm wondering (hoping I should say) that it is now possible.

Has anyone managed to do this? If it helps I'm using c# as the 'posting' medium.

Kind Regards
Reg
Argus
Re: HFCS INSERT via OLEDB
March 02, 2021 01:11PM
there is a recent discussion on the french pcsoft forum about this, if memory serves. Not interested in the problem myself, so don't really remember the details, but there seems to be several solutions depending on the details of the case.
Re: HFCS INSERT via OLEDB
March 02, 2021 04:37PM
Hi, thanks for that. I did actually get a response today from PCSOFT, so for anyone interested:

At the end of your INSERT statement you add the SELECT statement shown.

INSERT INTO tbl (auto,text) VALUES (NULL,'text');
SELECT LAST_INSERT_ID ();

Cheers
Reg
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: