Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2003
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Microsoft VBScript runtime error '800a01a8'

    I have been trying to write asp code for inserting data to the database. I have writen the following code and it keeps giving me the error does anyone has any idea about it?

    <%@ Language = "VBScript"%>
    <%


    'Declare all local variables
    dim conn
    dim rs
    dim strconn
    dim strsql
    Dim Customer_Name
    Dim Customer_Address
    Dim Customer_Postcode
    Dim Customer_Phone
    Dim Customer_Email

    Customer_Name = "A"
    Customer_Address = "39 Fern"
    Customer_Postcode = "AL10 10NB"
    Customer_Phone = "017072344"
    Customer_Email = "ashley@com"


    DBname = Server.MapPath("/anticus/fyp/deneme.mdb")

    If Len (Name) > 0 Then
    Set conn = Server.CreateObject("ADODB.Connection")
    'set connection string to local variable-I use a DSN-less connection
    'Need to modify just this line.Point to right path to database file.
    conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};Data Source=" & DBname & ";")
    'build the sql statement based on the input from the form
    'strSQL = "INSERT INTO Customer Contact Details(Customer_Name,Customer_Address, Customer_Postcode,Customer_Phone, Customer_Email ) Values('" & Customer_Name & "','" & Customer_Address & "','" & Customer_Postcode & "','" & Customer_Phone & "','" & Customer_Email & "')
    oConn.Execute(sql)

    Response.Write("Thank you " & Customer_Name & ", your name was successfully added into the database.")

    Else

    'If the fields didnt make it into the database, tell them
    Response.Write("You forgot one of the mandatory fields.")

    End if

    'Just make the BACK link here
    Response.Write("<br><a href=""javascript:history.back(1)"">Back</a>")

    'Close the objects

    DBCon.Close
    Set DBCon = Nothing
    %>

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <form action="customer details.asp" method="post" name="RegisterForm">
    <p>Your name: <input type="text" name="Customer_Name"></p>
    <p>Your address: <input type="text" name="Customer_Address"> </p>
    <p>Your postcode: <input type="text" name="Customer_Postcode"> </p>
    <p>Your Phone Number: <input type="text" name="Customer_Phone"> </p>
    <p>Your e-mail address: <input type="text" name="Customer_Email"></p>


    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you post the actual error that is given to you?

    Have you disabled friendly http errors in tools--->internet options---> advanced ? If not, go into there and uncheck "show friendly http error messages. It will then tell you specifically what line it is choking on.

  • #3
    Regular Coder
    Join Date
    Jan 2003
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts
    umm now i have sorted out the error bits, it's not giving any errors but now it is not putting the data into the database
    i have given the code in my other thread which is 'inserting data into a database'

    thanks

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll close this post to avoid confusion.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •