Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Author_ID unique ID
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Author_ID unique ID

 Post Reply Post Reply Page  <12
Author
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2005 at 10:47am
'******************************************
 '***     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
Back to Top
ramone_johnny View Drop Down
Groupie
Groupie


Joined: 13 May 2005
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote ramone_johnny Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2005 at 5:38pm
dj air,
mate, youre going to kill me when i tell you what the problem was!
 
I had an invalid unique ID within the peoples table that wasnt set correctly. When I carried out the upgrade from access to sql server ALL of my ID's within each table that should have been unique identifier werent.
 
I had to go through manually and reset them.
 
Embarrassed
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.