Updateing a record

M

Magua

Whenever i try to update a record i always get the dreaded "No
permissions"
here is my updates statement. Please help.

Function updateData()
cid = Request.QueryString("wrkstaID")
sql="UPDATE work_station SET "
sql=sql & "workstation='" & Request.QueryString("workstation") & "',"
sql=sql & "cpu='" & Request.QueryString("cpu") & "',"
sql=sql & "memory='" & Request.QueryString("memory") & "',"
sql=sql & "hard_Drive='" & Request.QueryString("harddrive") & "',"
sql=sql & "servicepack='" & Request.QueryString("servicepack") & "',"
sql=sql & " WHERE work_StationID='" & cid & "'"
on error resume next
conn.Execute sql
if err<>0 then
response.write("No update permissions!")
else
response.write("Record " & cid & " was updated!")
updateData = True
end if
'conn.close

End Function
 
E

Evertjan.

Magua wrote on 02 feb 2006 in microsoft.public.inetserver.asp.general:
Whenever i try to update a record i always get the dreaded "No
permissions"
here is my updates statement. Please help.

Function updateData()
cid = Request.QueryString("wrkstaID")
sql="UPDATE work_station SET "
sql=sql & "workstation='" & Request.QueryString("workstation") & "',"
sql=sql & "cpu='" & Request.QueryString("cpu") & "',"
sql=sql & "memory='" & Request.QueryString("memory") & "',"
sql=sql & "hard_Drive='" & Request.QueryString("harddrive") & "',"
sql=sql & "servicepack='" & Request.QueryString("servicepack") & "',"
sql=sql & " WHERE work_StationID='" & cid & "'"
on error resume next
conn.Execute sql
if err<>0 then
response.write("No update permissions!")
else
response.write("Record " & cid & " was updated!")
updateData = True
end if
'conn.close

End Function

You could be catching all other kinds of errors!

Change:

conn.Execute sql

to:

debug = true
if debug then
response.write sql
response.end
else
conn.Execute sql
end if

and show us the output.

btw, also tell us the type of database engine and your
set con =
line
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top