Visual Basic 6 & Access 2000
Hi,
This thread is meant as a meeting place for discussion about VB6 and Access in PIC/USB-related projects.
Keith, this tutorial explains database access much better than the Step By Step or Programmer's Guide books from Microsoft that came with my VB6 package.
http://www.vbexplorer.com/VBExplorer...er_ADO_DAO.asp
Robert
:)
Reading value of Autonum key after insert
-----------------------------------------------------
Dim ptrProfile as Long
Dim dbProfile As Database
Set dbProfile = OpenDatabase(strPath & "\" & strFilename)
Dim rsProfile As Recordset
Set rsProfile = dbProfile.OpenRecordset("tblProfile")
rsProfile.AddNew
rsProfile!Description = "bla bla bla"
rsProfile.Update
ptrProfile = rsProfile!ptrMenu <-- Primary key, Autonum
-----------------------------------------------------
According to one of my Access books this should place the new key into ptrProfile but it doesn't.
Am I supposed to set special parameters for update? Like UpdateNow or something like that? I see references to Cursor Types and Record Locks but I can't figure how to use them.
Robert
:)