Does anyone knows how to update specific record from database; for example a user sign in and would be able to update his/her own records only.
I use dreamwaver to set up update records but this will pulls all records in the table and user will have access to everyone records in that table to update.
following code works fine on localhost and old server but it doesn't work on my new server.
any help would be appreciated
<% If "Update Changes!" = Request.Form("Action") And _
Session("Status") = "Contracts" Then
Dim Ustring
Ustring = Session("BeanieBaby")
ContactName = Replace(Request("ContactName"),"'","")
Qualifications = Replace(Request("Qualifications"),"'","")
Position = Replace(Request("Position"),"'","")
Goal = Replace(Request("Goal"),"'","")
Url = Replace(Request("Url"),"'","")
Email = Replace(Session("Email"),"'","")
Status = Replace(Session("Status"),"'","")
Description = Replace(Request("Description"),"'","")
Company = Replace(Request("Company"),"'","")
Set Conn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\premfs1\sites\premium1\run\database\data.mdb;" & _
"Persist Security Info=False"
Conn.Open (sConnection)
sqlst2= "UPDATE Ads "
sqlst2= sqlst2 & "SET ContactName ='" & ContactName & "', "
sqlst2= sqlst2 & "Qualifications ='" & Qualifications & "', "
sqlst2= sqlst2 & "Url ='" & Url & "', "
sqlst2= sqlst2 & "Position ='" & Position & "', "
sqlst2= sqlst2 & "Goal ='" & Goal & "', "
sqlst2= sqlst2 & "Email ='" & Email & "', "
sqlst2= sqlst2 & "Description ='" & Description & "', "
sqlst2= sqlst2 & "Company ='" & Company & "', "
sqlst2= sqlst2 & "Status ='" & Status & "' "
sqlst2= sqlst2 & " WHERE ItemId='" & Ustring & "';"
'response.Write(sqlst2)
Conn.Execute(sqlst2)
Response.Redirect "itemaddsearch.asp"
End If %>
I keep getting error messages say syntex error line 271 and this is in line 271 Conn.Execute(sqlst2)
when I use response.write all records looks fine but still give me above error.
I use dreamwaver to set up update records but this will pulls all records in the table and user will have access to everyone records in that table to update.
following code works fine on localhost and old server but it doesn't work on my new server.
any help would be appreciated
<% If "Update Changes!" = Request.Form("Action") And _
Session("Status") = "Contracts" Then
Dim Ustring
Ustring = Session("BeanieBaby")
ContactName = Replace(Request("ContactName"),"'","")
Qualifications = Replace(Request("Qualifications"),"'","")
Position = Replace(Request("Position"),"'","")
Goal = Replace(Request("Goal"),"'","")
Url = Replace(Request("Url"),"'","")
Email = Replace(Session("Email"),"'","")
Status = Replace(Session("Status"),"'","")
Description = Replace(Request("Description"),"'","")
Company = Replace(Request("Company"),"'","")
Set Conn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\premfs1\sites\premium1\run\database\data.mdb;" & _
"Persist Security Info=False"
Conn.Open (sConnection)
sqlst2= "UPDATE Ads "
sqlst2= sqlst2 & "SET ContactName ='" & ContactName & "', "
sqlst2= sqlst2 & "Qualifications ='" & Qualifications & "', "
sqlst2= sqlst2 & "Url ='" & Url & "', "
sqlst2= sqlst2 & "Position ='" & Position & "', "
sqlst2= sqlst2 & "Goal ='" & Goal & "', "
sqlst2= sqlst2 & "Email ='" & Email & "', "
sqlst2= sqlst2 & "Description ='" & Description & "', "
sqlst2= sqlst2 & "Company ='" & Company & "', "
sqlst2= sqlst2 & "Status ='" & Status & "' "
sqlst2= sqlst2 & " WHERE ItemId='" & Ustring & "';"
'response.Write(sqlst2)
Conn.Execute(sqlst2)
Response.Redirect "itemaddsearch.asp"
End If %>
I keep getting error messages say syntex error line 271 and this is in line 271 Conn.Execute(sqlst2)
when I use response.write all records looks fine but still give me above error.