'******************************************
'*** Update datbase ***
'******************************************
'If this is new reg and the username and email is OK or this is an update then register the new user or update the rs
If
(strMode = "new" AND blnUsernameOK AND blnEmailOK AND blnSecurityCodeOK
AND blnEmailBlocked = False) OR (strMode = "update" AND
blnConfirmPassOK) Then
'If this is new then create a new rs and reset session variable
If strMode = "new" Then
Session("lngSecurityCode") = null
rsCommon.AddNew
End If
'Insert the user's details into the rs
With rsCommon
&a mp;nbs
p;
If strMode = "new" Then .Fields("Username") = strUsername
If strMode = "new" Then .Fields("Group_ID") = intForumStartingGroup
&a mp;nbs
p;
'If part number = 0 (all) or part 1 (reg details) then run this code
If intUpdatePartNumber = 0 OR intUpdatePartNumber = 1 Then
&a mp;nbs
p;
If (strMode = "update" AND blnPasswordChange = True) OR strMode = "new" Then .Fields("Password") = strEncryptedPassword
If (strMode = "update" AND blnPasswordChange = True) OR strMode = "new" Then .Fields("Salt") = strSalt
.Fields("User_code") = strUserCode
.Fields("Author_email") = strEmail
.Fields("firstname") = strFirstname
.Fields("lastname") = strLastname
.update
.requery
.movelast
'GET THE USERS AUTHOR_ID NUMBER
user_id = rsCommon("Author_ID") *doesnt appear to work??????
End If
I then use it later do to the following - however this fails as I have no value for user_id
'ADD TO THE PEOPLES TABLE
Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * From people;"
objRS.MaxRecords = 1
objRS.CursorType = 2
objRS.LockType = 3
objRS.Open strSQL, adoCon
objRS.AddNew
objRS.Fields("userID") = user_id
objRS.Fields("firstname") = strFirstname
objRS.Fields("lastname") = strLastname
objRS.Update
objRS.Close
Set objRS = Nothing
'CREATE USERS PHOTO ALBUM FOLDER
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists(Server.MapPath(strPath) & "/" & user_id) then
objFSO.CreateFolder Server.MapPath(strPath) & "/" & user_id
end if
Set objFSO = nothing
-----------
try the above, can you past the above query thats not shown (the one above that segmaent of code)
so i can make sure it will get the last record in the database
the parts in read will update the author table setting the author_ID
value, then it requerys the table (not sure on the query so cant tell
yet), and ive set it to move to lthe last/latest record where it then
gets the author_ID value