Forum Moderators: open
the error I get is:
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
/hemisphe/prolg.asp, line 32
My asp page writing it has code of:
<%
Dim intCounter, intDecimal, strPasswordFor intCounter = 1 To 6
Randomize
intDecimal = Int((26 * Rnd) + 1) + 64
strPassword = strPassword & Chr(intDecimal)
Next
set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
server.MapPath("data/hemicustreg.mdb")
connection.Open
sql="INSERT INTO [customer] ([cmpname], [address], [city], [state], [zip], [number], [contact], [email], [system], [pwrd], [username])"
sql=sql & "VALUES"
sql=sql & "('" & Request.Form("cmpname") & "',"
sql=sql & "'" & Request.Form("address") & "',"
sql=sql & "'" & Request.Form("city") & "',"
sql=sql & "'" & Request.Form("state") & "',"
sql=sql & "'" & Request.Form("zip") & "',"
sql=sql & "'" & Request.Form("number") & "',"
sql=sql & "'" & Request.Form("contact") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("system") & "',"
sql=sql & "'" & strpassword & "',"
sql=sql & "'" & Request.Form("username") & "')"
connection.Execute(sql)
Dim Mail
Set Mail=Server.CreateObject("CDONTS.NewMail")
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<TITLE>Send Mail with HTML</TITLE>"
HTML = HTML & "</HEAD>"
HTML = HTML & "<BODY>"
HTML = HTML & "<TABLE cellpadding=""4"">"
HTML = HTML & "<TR><TH><FONT color=""red"">"
HTML = HTML & "<IMG SRC=""myImage.gif""></A><BR><BR>"
HTML = HTML & "<h2>Thank you for Registering with Example Communications</h2></TH></TR>"
HTML = HTML & "<TR><TH><FONT color=""blue"" SIZE=""4"">"
HTML = HTML & "Your password is " & strPassword
HTML = HTML & "<BR><BR>"
HTML = HTML & "To Log In <a href=""http://www.example.net/login.html"">Click Here</a> or go to http://www.example.net/login.html</TH></TR>"
HTML = HTML & "</FONT></TD></TR></TABLE><BR><BR>"
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
Mail.to=Request.Form("email")
Mail.From="lblendowski@example.net"
Mail.Subject="example.net Registration"
Mail.MailFormat= 0
Mail.BodyFormat=0
Mail.Body=HTML
Mail.Send
Set Mail=nothing
if err<>0 then
Response.Write(Err.Description)
else
response.redirect("tyreg.html")
end if
connection.close
%>
Can someone please point out what I am doing wrong? Should the code be UPDATE instead of INSERT?
Any help is greatly appreciated!
[edited by: encyclo at 8:40 pm (utc) on Dec. 4, 2006]
[edit reason] examplified [/edit]