Hi there
I've got the following problem scenario.
After inserting a new record into a table with a auto_inc
id, I need to get the new id back to insert into another table.
I use the following code to do this:
dim rs as recordset
dim newid as long
'this works
set rs = dataenvironment.connection
This works for me. You will have to translate the javascript to whatever you are using
...
SQL = "insert into myTable(field2, field3, field4) values("dat2", "dat3", "dat4")"
var dataConn = Server.CreateObject("ADODB.Connection");
dataConn.open(MM_soCalData_STRING);
var rs1 = dataConn.Execute
I have run into this problem in Access using MyODBC. Access will try to
evaluate the function last_insert_id() before it passes the query to the
database. It will do this EVEN if I say it is a 'dbSQLPassThrough' query.
Very aggravating.
j- k-
On Sunday 29 April 2001 06:23, [EMAIL PR
I have found the solution for my 'select LAST_INSERT_ID();' problem.
I must check the 'Change BIGINT columns to INT' option in the
ODBC entry options in my NT server and everything work fine.
Why this ?
This means that I never use BIGINT columns in my Database ?
Thanks.
Regards.
The context is Active Server Pages application over IIS in NT server.
This code is in a file named DatiPrev.asp :
Open the connection using ODBC (I use MyODBC):
> set objConn = Server.CreateObject("adodb.connection")
> objConn.Open Application("Connection1_ConnectionString")
and this is the instru
On Sun, Apr 29, 2001 at 03:38:07PM +0200, [EMAIL PROTECTED] wrote:
> My insert query look like your
> 'INSERT INTO ordinit(ID_ordine, Cod_Cliente) VALUES (NULL, 10);';
> after the query I look into the table 'ordinit' and always looks fine: the value of
> ID_ordine is really incremented.
> But th
My insert query look like your
'INSERT INTO ordinit(ID_ordine, Cod_Cliente) VALUES (NULL, 10);';
after the query I look into the table 'ordinit' and always looks fine: the value of
ID_ordine is really incremented.
But the following 'select LAST_INSERT_ID()' return zero :-((
It looks like a bug ?
Hi,
On Sat, Apr 28, 2001 at 05:12:42PM +0200, Antonino Chirco wrote:
> Mysql : 3.23.33
> server : NT 4.0 S.P.3
> Client : Win98
>
> This is the table structure:
> CREATE TABLE `ordinit` (
> `ID_Ordine` int(11) NOT NULL auto_increment,
> `Cod_Cliente` int(11) default NULL,
>
> .. OMISSIS ..
Mysql : 3.23.33
server : NT 4.0 S.P.3
Client : Win98
This is the table structure:
CREATE TABLE `ordinit` (
`ID_Ordine` int(11) NOT NULL auto_increment,
`Cod_Cliente` int(11) default NULL,
.. OMISSIS ..
PRIMARY KEY (`ID_Ordine`)
) TYPE=MyISAM
the query 'select last_insert_id()' after an