Read the ID just inserted into the record

xiaoxiao2021-03-06  71

SQL = "Set NoCount on; INSERT INTO DOCTMPL (Title) VALUES ('" & repeate (strtitle, "'"; ") &"); select @@ identity; set nocount off "set RS = CN. Execute (SQL) if xi e f i 没有 没有 没有 没有 记 i i 进行 进行..................................... Execute ("INSERTITINTO ....") 'Query SQL statement for the new record ID number setrs = conn.execute ("SELECT @@ IdentityAsGuideID") ID = RS ("GuideID")' Submit transaction Conn.committransmyrs.open strsql , myCn1,2,3If myRs.EOF Then myRs.AddNew myRs ( "a_Name") = strUserName myRs ( "A_LoginName") = strLoginName myRs ( "A_Domain") = LoginUserDomain myRs ( "A_email") = email myrs ( "A_IsEnabled" ) = 1 myrs ( "A_Password") = EncryptPwd myRs.Update bookmark = myRs.absolutePosition 'First, store the location of you cursor myRs.Requery' Next, update your recordset with the data from the database

'after the requery

转载请注明原文地址:https://www.9cbs.com/read-109663.html

New Post(0)