View Full Version : Microsoft VBScript runtime error '800a01a8'

02-06-2003, 03:07 PM
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 & "')

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


'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

Set DBCon = Nothing

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

<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>


02-06-2003, 06:06 PM
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.

02-06-2003, 06:13 PM
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 :)

02-07-2003, 12:44 AM
I'll close this post to avoid confusion. :)