ASP & SQL Insert problem

[b][red]This message was edited by Iggy at 2004-4-10 3:55:10[/red][/b][hr]
I'm having problems updating an Access databse with this code:



UserName :
Full Customer Name:
Password :
Address :
Town :
Post Code :
Tel No :
E-Mail :




Which links to this:

<%
Set MyConn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
Server.MapPath("eggyharolddbCTC.mdb")


SQL ="INSERT INTO CUSTOMERS (UserName, CustomerName, Password, Address, Town, PostCode, TeleNumber, Email) values "
SQL = SQL & "('"
SQL = SQL & Request.Form("UserName") & "','"
SQL = SQL & Request.Form("CustomerName") & "','"
SQL = SQL & Request.Form("Password") & "','"
SQL = SQL & Request.Form("Address") & "','"
SQL = SQL & Request.Form("Town") & "','"
SQL = SQL & Request.Form("PostCode") & "','"
SQL = SQL & Request.Form("TeleNumber") & "','"
SQL = SQL & Request.Form("Email") & "');"

MyConn.Execute SQL

%>

I can't see what the error is. I'm new to ASP and SQL, and don't have access to IIS so I'm not getting error messages, just page not found web errors.



Comments

  • : [b][red]This message was edited by Iggy at 2004-4-10 3:55:10[/red][/b][hr]
    : I'm having problems updating an Access databse with this code:
    :
    :
    :
    : UserName :
    : Full Customer Name:
    : Password :
    : Address :
    : Town :
    : Post Code :
    : Tel No :
    : E-Mail :
    :
    :
    :
    :
    : Which links to this:
    :
    : <%
    : Set MyConn = Server.CreateObject("ADODB.Connection")
    : Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
    : Server.MapPath("eggyharolddbCTC.mdb")
    :
    :
    : SQL ="INSERT INTO CUSTOMERS (UserName, CustomerName, Password, Address, Town, PostCode, TeleNumber, Email) values "
    : SQL = SQL & "('"
    : SQL = SQL & Request.Form("UserName") & "','"
    : SQL = SQL & Request.Form("CustomerName") & "','"
    : SQL = SQL & Request.Form("Password") & "','"
    : SQL = SQL & Request.Form("Address") & "','"
    : SQL = SQL & Request.Form("Town") & "','"
    : SQL = SQL & Request.Form("PostCode") & "','"
    : SQL = SQL & Request.Form("TeleNumber") & "','"
    : SQL = SQL & Request.Form("Email") & "');"
    :
    : MyConn.Execute SQL
    :
    : %>
    :
    : I can't see what the error is. I'm new to ASP and SQL, and don't have access to IIS so I'm not getting error messages, just page not found web errors.
    :
    :
    :
    :


    Conn.Open should be MyConn.Open

    and at the end of your code you should set:
    MyConn.close
    set MyConn = Nothing


    sometimes that will prevent the page from loading if you don't include that ( with brinkster webspace anyways )
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • : : [b][red]This message was edited by Iggy at 2004-4-10 3:55:10[/red][/b][hr]
    : : I'm having problems updating an Access databse with this code:
    : :
    : :
    : :
    : : UserName :
    : : Full Customer Name:
    : : Password :
    : : Address :
    : : Town :
    : : Post Code :
    : : Tel No :
    : : E-Mail :
    : :
    : :
    : :
    : :
    : : Which links to this:
    : :
    : : <%
    : : Set MyConn = Server.CreateObject("ADODB.Connection")
    : : Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
    : : Server.MapPath("eggyharolddbCTC.mdb")
    : :
    : :
    : : SQL ="INSERT INTO CUSTOMERS (UserName, CustomerName, Password, Address, Town, PostCode, TeleNumber, Email) values "
    : : SQL = SQL & "('"
    : : SQL = SQL & Request.Form("UserName") & "','"
    : : SQL = SQL & Request.Form("CustomerName") & "','"
    : : SQL = SQL & Request.Form("Password") & "','"
    : : SQL = SQL & Request.Form("Address") & "','"
    : : SQL = SQL & Request.Form("Town") & "','"
    : : SQL = SQL & Request.Form("PostCode") & "','"
    : : SQL = SQL & Request.Form("TeleNumber") & "','"
    : : SQL = SQL & Request.Form("Email") & "');"
    : :
    : : MyConn.Execute SQL
    : :
    : : %>
    : :
    : : I can't see what the error is. I'm new to ASP and SQL, and don't have access to IIS so I'm not getting error messages, just page not found web errors.
    : :
    : :
    : :
    : :
    :
    :
    : Conn.Open should be MyConn.Open
    :
    : and at the end of your code you should set:
    : MyConn.close
    : set MyConn = Nothing
    :
    :
    : sometimes that will prevent the page from loading if you don't include that ( with brinkster webspace anyways )
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :

    Thanks.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories