Αρχή :: Ενότητες :: Scripting :: Απαντήσεις     
 

Forum

SQL Update - Από {gouris}

Exw auton to kwdika se ena arxeio asp kai to xrhshmopoiw gia na kanw edit kai delete se kapoies egrafes se mia bash dedomenon. An kai to delete douleuei kanonika otan trexw to edit mou bgazei ena munhma sfalmatos gia thn suntaksi tou update. Kserei kaneis pou yparxei lathos?
Autos einai o kwdikas:


Submit DataBase


Submit to Database


<%
Set conn = server.CreateObject("ADODB.Connection")
conn.provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open (server.mappath("db1.mdb"))

If Request.form("action") = "Save" Then
UserID = Request.form("UserID")
sql = "UPDATE users SET Username='" & Request.form("Username") & "',"
sql = sql & "Password='" & Request.form("Password") & "',"
sql = sql & "Fysikh='" & Request.form("Fysikh") & "',"
sql = sql & "Hlektronika='" & Request.form("Hlektronika") & "',"
sql = sql & "Thlematikes='" & Request.form("Thlematikes") & "',"
sql = sql & " WHERE users.[UserID]=" & UserID
conn.Execute sql,RecordsAffected
If Err <> 0 Then
Response.write ("You do not have permission to update this database!")
Else
Response.write ("Record number " & UserID & " was updated.")
End If
End If
If Request.form("action") = "Delete" Then
UserID = Request.form("UserID")
conn.Execute "DELETE FROM users WHERE users.[UserID]=" & UserID, Recordsaffected
If Err <> 0 Then
Response.write ("You do not have permission to delete a record from this database!")
Else
Response.write ("Record number " & UserID & " was deleted.")
End If
End If

conn.close%>



 


Απάντηση από:Alex

Απάντησε με το error.

Απάντηση από:Alex

Δώσε modify άδειες στον IUSER ή στoν everyone από τον NTFS



tip: Web hosting Unix με Bandwith + Disk space Απεριόριστο μόνο 2.30 € * F5 για νέο tip

   Πίσω στην προηγούμενη σελίδα






Η Εταιρία | Web Hosting | Domain names | Web Information | Υπηρεσίες | Resellers | Υποστήριξη |
Copyright © 2007–09 4GR.NETWORKS, All rights reserved.