Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2007, 05:40 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default error with insertV.asp to database

<html dir="rtl">
    <head>
    </head>
    <body bgcolor="yellow">
<%
fname = Request.Form ("fname")
lname = Request.Form ("lname")
byear = Request.Form ("byear")
address = Request.Form ("address")
email = Request.Form ("email")
phone = Request.Form ("pon2") & "-" & Request.Form ("pon1")
cphone = Request.Form ("cpon2") & "-" & Request.Form ("cpon1")
if (Request.Form ("toar")="true") then
    toar=True
else
    toar=False
end if

if (Request.Form ("exper")="true") then
    exper=True
else
    exper=False
end if

if (Request.Form ("hebrew")="true") then
    hebrew=True
else
    hebrew=False
end if

if (Request.Form ("english")="true") then
    english=True
else
    english=False
end if

if (Request.Form ("arabic")="true") then
    arabic=True
else
    arabic=False
end if

if (Request.Form ("france")="true") then
    france=True
else
    france=False
end if

if (Request.Form ("spanish")="true") then
    spanish=True
else
    spanish=False
end if

if (Request.Form ("rusion")="true") then
    rusion=True
else
    rusion=False
end if

if (Request.Form ("other")="true") then
    other=True
else
    other=False
end if


byear=CInt(byear)

Function fixQuotes(theString)
    fixQuotes=Replace(theString, "'", "''")
End Function

fname =fixQuotes(fname)
lname =fixQuotes(lname)
byear =fixQuotes(byear)
address =fixQuotes(address)
email =fixQuotes(email)

Set oConn = Server.CreateObject("ADODB.Connection")

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=" & Server.MapPath("db\atar.mdb") & ";" & _
           "Uid=admin;" & _
           "Pwd=;"

mySQL = "SELECT * FROM reg WHERE (fname='" & fname & "' AND lname='" & lname & "' AND email='" & email & "' AND byear=" & byear & ")"

Set oRS = oConn.Execute (mySQL)

If oRS.EOF Then
    mySQL = "INSERT INTO reg (fname, lname, byear, address, email, phone, cphone, toar, exper, hebrew, english, arabic, france, spanish, rusion, other) " &_
            "VALUES (" &_
                     "'" & fname & "'" & ", " &_
                     "'" & lname & "'" & ", " &_
                     bYear & ", " &_
                     "'" & address & "'" & ", " &_
                     "'" & email & "'" & ", " &_
                     "'" & phone & "'" & ", " &_
                     "'" & cphone & "'" & ", " &_
                     toar & ", " &_
                     exper & ", " &_
                     hebrew & ", " &_
                     english & ", " &_
                     arabic & ", " &_
                     france & ", " &_
                     spanish & ", " &_
                     rusion & ", " &_
                     other &_
                     ")"
    oConn.Execute (mySQL) <--------The error is stated.
    Response.Write "<h1 align='center'>úåãä ìê, ôøèéê ðøùîå áäöìçä </h1>"
    Response.Write "<br />"
Else
    Response.Write "<h1 align='center'> ëáø ðøùîú ëîúðãá áàúø, àðå ðôðä àìéê áîéãú äöåøê </h1>"
    Response.Write "<br />"
End If


oRS.Close
Set oRS = Nothing

oConn.Close
Set oConn = Nothing

%>


    </body>
</html>


it returns:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/site/asp/insertV.asp, line 111


thanks for taking the time to read.

 
Old June 4th, 2007, 03:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look here: http://www.spaanjaars.com/QuickDocId.aspx?quickdoc=263

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old June 4th, 2007, 09:28 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks the info helped,im kinda a clutz,didn't notice the database properties's write checked off >.<
thanks. =)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using "." while querying database..asp gives error Shuchik Classic ASP Basics 2 September 17th, 2007 02:47 AM
DataBase Error in ASP sadik Classic ASP Databases 1 March 14th, 2005 08:50 AM
ASP 0177 error creating database [email protected] Classic ASP Databases 6 March 3rd, 2005 01:43 PM
ASP or Database error naveedmustafa Classic ASP Databases 3 December 31st, 2004 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.