<% function AddUser(ByRef pobjCon, ByVal pstrName, ByVal pstrEmail, _ ByVal pstrPassword, ByVal pstrForeignID, ByVal pblnIsTest) Dim objRs, intUserID, blnFirstUser, strSQL call BeginTransaction(pobjCon, "AddUser") strSQL = "SELECT COUNT(*) FROM forumUsers" set objRs = OpenRS(pobjCon, strSQL) blnFirstUser = (objRs(0)=0) objRs.Close set objRs = nothing Set objRs = Server.CreateObject ("ADODB.Recordset") call objRs.Open("forumUsers", pobjCon, adOpenKeySet, adLockPessimistic, adCmdTable) call objRs.AddNew() objRs.Fields.Item("username").Value = pstrName objRs.Fields.Item("email").Value = pstrEmail objRs.Fields.Item("logins").Value = 1 objRs.Fields.Item("lastlogin").Value = Now objRs.Fields.Item("foreignID").Value = pstrForeignID objRs.Fields.Item("password").Value = pstrPassword objRs.Fields.Item("admin").Value = blnFirstUser 'first user is admin objRs.Fields.Item("anyBoardRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("anyGroupRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("anySysopRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("anyModeratorRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("anyWriteRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("anyReadRights").Value = blnFirstUser 'first user has rights objRs.Fields.Item("moderator").Value = false objRs.Fields.Item("profile").Value = true objRs.Fields.Item("isTest").Value = pblnIsTest call objRs.Update() intUserID = GetNewID(pobjCon, objRs) objRs.Close set objRs = Nothing call CommitTransaction(pobjCon, "AddUser") AddUser = Clng(intUserID) end function %>