-
Download
I am trying to add data to a database when i click the submit button i am asked to download the asp instead of it actually doing the code what is going wrong please:
<html>
<table>
<tr><td>name</td><td>address</td></tr>
<% @language=vbscript %>
<!--#include file="adovbs.inc"-->
<%
dim conn, rs
dim strQ
dim txtsurname
txtsurname = request.querystring("surname")
dim txtinitials
txtinitials =request.querystring("initials")
dim txtAdd1
txtAdd1 =request.querystring("Address1")
dim txtAdd2
txtAdd2=request.querystring("Address2")
dim txtcity
txtcity =request.querystring("City")
dim txtpost
txtpost =request.querystring("Post Code")
dim txtHmphone
txtHmphone =request.querystring("Home Telephone")
dim txtMoby
txtMoby =request.querystring("Mobile Telephone")
dim txtemail
txtemail =request.querystring("email")
dim txtFee
txtFee =request.querystring("Fee")
set conn=server.CreateObject("ADODB.connection")
conn.Open "DRIVER=Microsoft Access Driver (*.mdb) ; DBQ=" & Server.MapPath("heenaA1")
set rs = server.CreateObject ("ADODB.Recordset")
strQ = "Select * from webBooking"
rs.Open strQ, conn, adOpenDynamic, adLockOptimistic, adCmdText
rs.AddNew
rs("surname")= txtsurname
rs("initials")= txtinitials
rs("Address1")= txtAdd1
rs("Address2")= txtAdd2
rs("City")= txtcity
rs("PostCode")= txtpost
rs("HomeTelephone")= txtHmphone
rs("MobileTelephone")= txtMoby
rs("email")=txtemail
rs("Fee")= txtFee
rs.Update
rs.Close
response.write "Record added"
Conn.close
%>
</html>
-
are you running the asp page on a IIS serveR?
if you dont have IIS server it will ask you to download it
-
Look on your other thread here nutstretch, I answered this question there.