Hi everyone,
I need some help..
I use ADODB object connecting to MS Access database..
following codes is to negotiate with database..
if i were to insert values in the table.. how can i return the primary key of the table after inserting?
===========================================================
Set Rs = Nothing
Set Rs = New ADODB.Recordset
If bReadOnly Then
Rs.Open sSQLStatement, Cn, adOpenStatic, adLockReadOnly
Else
Rs.Open sSQLStatement, Cn, adOpenDynamic, adLockOptimistic
End If
===========================================================
rsInsertHeader.AddNew
rsInsertHeader("tableid".Value = nvl(.txtLockerNo.Text, ""
rsInsertHeader.Update
===========================================================
I need some help..
I use ADODB object connecting to MS Access database..
following codes is to negotiate with database..
if i were to insert values in the table.. how can i return the primary key of the table after inserting?
===========================================================
Set Rs = Nothing
Set Rs = New ADODB.Recordset
If bReadOnly Then
Rs.Open sSQLStatement, Cn, adOpenStatic, adLockReadOnly
Else
Rs.Open sSQLStatement, Cn, adOpenDynamic, adLockOptimistic
End If
===========================================================
rsInsertHeader.AddNew
rsInsertHeader("tableid".Value = nvl(.txtLockerNo.Text, ""
rsInsertHeader.Update
===========================================================