Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Try Using AddNew Method
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Try Using AddNew Method

 Post Reply Post Reply Page  12>
Author
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Topic: Try Using AddNew Method
    Posted: 09 May 2005 at 8:07am
Nice to be here again. To be here is either you have problem or hepling others so here for you to help me out.

I am trying to add new records to an exiting userID in access database.
Understand me very well, I created registration form for mulitiple users. When userA, userB AND userD done with registration and log in to they account to view they profile or edit it.
Then if I as an Administrator want to add new records to userB so that userA and userD with not see the new record i add to userB. So,I want each of them to have a different information in they profile.

I try to use AddNew method but is not working at all.
Help!

ThxNice to be here again. To be here is either you have problem or hepling others so here for you to help me out.

I am trying to add new records to an exiting userID in access database.
Understand me very well, I created registration form for mulitiple users. When userA, userB AND userD done with registration and log in to they account to view they profile or edit it.
Then if I as an Administrator want to add new records to userB so that userA and userD with not see the new record i add to userB vis visa. So,I want each of them to have a different information in they profile.

I try to use AddNew method but is not working at all.
Help!

Thx
NgWebDesigns
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2005 at 7:07pm
try using an sql insert
 
sql = "INSERT INTO tbl1 (col1, col2, col3) VALUES (val1, val2, val3)"
adoCon.Execute sql
 
to make it so that only userA can see userA's specific records, set a relationship between the key field of the user information table (the one where you keep passwords etc) and an equivalent field in the table where the new records will be kept.
 
For example, if userA has an ID number of 0001, then create a field in the table you want to add new things to called userID or something like that, and then use the sql insert to add the new record. Like this:
 
userIDvar = {the ID of the user}
sql = "INSERT INTO tbl2 (column1, column2, column3, userID) VALUES (value1, value2, value3, userIDvar)"
adoCon.Execute sql
 
hope that makes sense.
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 5:45am
 I don't really understand.
Doses it means that i shall have 2 tbls in my database. if i create the relationship shall i point it to tbl1 primary key and tbl2 primary key.
 
This is how i did mine:
 
userID = request.querystring("ID")
 
strVALS1 = request.form("txtVals1")
strVALS2 = request.form("txtVals2")
strVALS3 = request.form("txtVals3")
 
sql = "INSERT INTO ([col1,col2, col3, U_ID]) VALUES ('" & strVALS1 & "', '" & strVALS2 & "', '" & strVALS3 & "', userID)"
adCon.execute sql
 
But is still not working
 
In my admin area where i select the member i wish to add new records to it profile using it assign ID. That is the ID when the member get registered.
 
Just tell me how the 2 tbls is going to look like.
Please still help me out.
NgWebDesigns
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 13 June 2005 at 7:04pm
yes, two tables.
 
Table 1
One would have username, password and other relevant details (like contact details - phone number, address, etc) as well as a UserID field which would be and autonumber
 
Table 2
The other table would have whatever fields you need in it for the new records, as well as a UserID field which was simply text.
 
then you would set a one-to-many relationship from UserID in Table 1 to UserID in Table 2. Then use the sql insert into table 2, inserting userID as appropriate for the user.
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2005 at 6:04am
Thanks For your help, i really appreciate it.
More help please.
In Table2 the UserID will it be autonumber or a simply text.

NgWebDesigns
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2005 at 7:03pm
text. it needs to be able to have multiple records with the same UserID, which autonumber will not allow
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2005 at 1:08am
I was never able to get the AddNew method to work for some reason. Stick to SQL.. it'll take you like ten minutes to learn the four basic functions (SELECT, UPDATE, INSERT INTO, DELETE).
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2005 at 6:08am
Am very grateful for your help.
It works vey well now but i'm still having alittle problem.
 
How can i use SELECT METHOD to display the record in tbl2?
I try to do that but am having an error when i want to display it.
 
something like this:-
Error: Data type mismatch in criteria expression.
 
So, this is how i did mine.
 
userID = request.querystring("ID") 
 
strSQL = "SELECT [col1], [col2], [col3], [uid] FROM tbl2 WHERE uid=" & userID
 
But is not working. Plz, help me out.
NgWebDesigns
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.