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 PROTECTED] wrote:
> 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
--
Joshua Kugler
Associated Students of the University of Alaska Fairbanks
Information Services Director
[EMAIL PROTECTED]
907-474-7601
---------------------------------------------------------------------
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