Changes

ADO Database Connection VB6

501 bytes added, 20:15, 10 January 2008
The following lines were added (+) and removed (-):
== Example: Obtaining Autonumber Value After Using Recordset AddNew ==  Set rs1 = New ADODB.Recordset  rs1.CursorLocation = adUseClient  rs1.Open "TableName", cn, adOpenKeyset, adLockOptimistic  rs1.AddNew    rs1!FirstName = Trim("" & txtCon(0).Text)    rs1!LastName = Trim("" & txtCon(1).Text)  rs1.Update  NewCID = rs1!CID  rs1.CloseThe variable NewCID now has the autonumber value.  CID is the name of the table field that is set to Autonumber and is also the key field for the table.
Bureaucrat, administrator
16,212
edits