Re: Returning Informix serial id to VB after insert
Posted in 1998
A couple of ideas: 1. Use a StoredProcedure "AddRow" that inserts the new row and returns the serial number of the row. To call from VB/DAO: SET rs=database_object.execute ("execute procedure AddRow(parms..)" ,dbOpenSnapshot, dbSqlPassthrough) Row_ID = rs(0) 2. Do the INSERT from VB with a dummy element, and retreive the row later. Include a date/time field defaulted to NOW so you can guarantee you are pulling the latest row back. Hope this helps, Mike Lester USAA Investement Management Company Lem_Oandasan@providian.com wrote in message <6ec83d$q83$1@nnrp1.dejanews.com>... >Apologies if this is a FAQ. > >Is there a simple method to retrieve the serial id of a newly >inserted row from an Informix table using VB? > >The code will be something like: >database_object.execute "insert into table values ....." > >Do I need stored procedures or triggers to make this work? > >tia, > >Lem Oandasan >Lem_Oandasan@providian.com > >-----== Posted via Deja News, The Leader in Internet Discussion ==----- >http://www.dejanews.com/ Now offering spam-free web-based newsreading