Changes

ADO Database Connection VB6

597 bytes added, 12:58, 2 February 2008
[[ADO Database Connection]] moved to [[ADO Database Connection VB6]]
The following lines were added (+) and removed (-):
References requires in Visual BASIC 6.0: <big>Microsoft ActiveX Data Objects 2.7 Library</big>   == 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,192
edits