Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting data into an existing record

Status
Not open for further replies.

Jayuk

Programmer
Feb 5, 2002
6
GB
I am trying to find out how to insert data into an existing record in a database based on the user's unique ID number.

I have managed to move to the relevant record by checking if the ID number matches the URL parameter passed to it, but cannot seem to get it to insert into the appropriate record.

Any help that anyone could offer would be much appreciated.


Jennie
Cyber Marketing Administrator

* Sorry ASP newbie * I suppose we all have to start somewhere!
 
You should use an Update Sql statement, for example :

sql = "UPDATE TABLE_NAME set FIELD1 = '" & field1 & "', FIELD2 = '" & field2 & "', FIELD3 = '" & field3 & "' where USER_ID = " & Request.QueryString("USER_ID") &

Where capital letters indicate field names and lowercase letters indicate variables to put into the record.

Hope this helps,

Sarah
User_timtom.jpg
WASN'T FIT ENOUGH FOR THE POLICE FORCE
 
Or stay with insert

insert into tablename(param1,param2) values (1 ,2) where id = yourid

Regards gsc1ugs
"Cant see wood for tree's...!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top