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 instruction :
> mSql = "Insert into ordinit (ID_Ordine, Cod_Cliente, Data_Ordine,
Ora_Ordine, Evaso, Tipo, PercSconto, ImpSconto, TotImp, TotIVA,
ImpTotale, Status) values(NULL, " & mCodCliente & "," & sDate & ",
'" & sTime & "', 'N', '" & mTipo & "', 0, 0, " & mTotImp & ", " &
mTotIVA & ", " & mTotImp + mTotIVA & ", 'de');"
> set objRS = objConn.Execute (mSql)
> mSql = "select last_insert_id();"
> set objRS = objConn.Execute (mSql)
> response.write(objRS.Fields(0))
This is the error:
>Microsoft OLE DB Provider for ODBC Drivers error '80020009'
>[Microsoft][ODBC Driver Manager] Il driver non supporta questo parametro.
The driver not support this parameter.
I think that the problem is MyODBC.
But I have tried also with MySQLGUI client and the return value is zero.:-(
Regards.
Nino.
> Weird. I've used them often (on ISAM tables) and it works just fine.
>
> Do you use the same connection for the 'LAST_INSERT_ID' query as for
> the INSERT query? The LAST_INSERT_ID is kept per connection and until
> another INSERT is done.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php