Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> ADO Addnew and identity columns

ADO Addnew and identity columns

From: Jan van Veldhuizen <jan_at_van-veldhuizen.nl>
Date: Wed, 6 Oct 2004 13:31:10 +0200
Message-ID: <4163d817$0$78279$e4fe514c@news.xs4all.nl>


I have an application which is running fine with MS SqlServer, but it should be working with Oracle as weel.
At a lot of places we rely upon the ADO Recordset to return incremented identity columns.
Oralce however returns null or zero.
How can this be fixed easily?

Dim mConn As New ADODB.Connection
Dim rs As New ADODB.Recordset

mConn.ConnectionString = "Provider=OraOLEDB.Oracle;User ID=user;Password=pwd;Data Source=dbname;" mConn.Open

rs.Open "select * from testidentity where id < -1", mConn, adOpenForwardOnly, adLockPessimistic
rs.AddNew "name", "peter"
rs.Update
MsgBox rs("id")

mConn.Close Received on Wed Oct 06 2004 - 06:31:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US