hi,
ive got a asp page that tries to write to a data base, but it produces an error that i cant figure out
here's the error code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name too long
/registerinterest.asp, line 43
heres my code:
<%@ Language="VBScript" %>
<% Option Explicit %>
<% Response.Buffer = True %>
<html>
<head>
<% 'Create Cookie on client computer to allow the site to recognise the prospective client
'Variables
Dim sname , fname , add1 , add2 , pcode , daytel , evetel
Dim mobtel , btoc , detreq , Con , SQL , Application
Dim ipRS
'Obtain information from form
fname=Replace(Request.Form("fname"
,"'","''"
sname=Replace(Request.Form("sname"
,"'","''"
add1=Replace(Request.Form("add1"
,"'","''"
add2=Replace(Request.Form("add2"
,"'","''"
pcode=Replace(Request.Form("pcode"
,"'","''"
daytel=Replace(Request.Form("daytel"
,"'","''"
evetel=Replace(Request.Form("evetel"
,"'","''"
mobtel=Replace(Request.Form("mobtel"
,"'","''"
btoc=Replace(Request.Form("btoc"
,"'","''"
detreq=Replace(Request.Form("detreq"
,"'","''"
'Set Cookie
Response.Cookies("ProspectiveCookie"
("fname"
= fname
Response.Cookies("ProspectiveCookie"
("sname"
= sname
Response.Cookies("ProspectiveCookie"
("dofinq"
= Date
Response.Cookies("ProspectiveCookie"
.Expires = Date + 30 'write expiry date
Response.Cookies("ProspectiveCookie"
.Domain = "pjosiah.co.uk" 'write Domian name 4 access
%>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "Providor=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("databases/pj.mdb"
&";" 'line 43
'Insert record into the database
SQL = "INSERT INTO reginterest(fname , sname , add1 , add2 , pcode , daytel , evetel, mobtel , btoc , detreq)VALUES('"&fname&"','"&sname&"','"&add1&"','"&add2&"','"&pcode&"','"&daytel&"','"&evetel&"','"&mobtel&"','"&btoc&"','"&detreq&"')"
Set ipRS=Server.CreateObject("ADODB.Recordset"
ipRS.open SQL, con
MyConn.Close()
Set Conn = Nothing
response.write("done"
%>
</body>
</html>
thanx
ive got a asp page that tries to write to a data base, but it produces an error that i cant figure out
here's the error code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name too long
/registerinterest.asp, line 43
heres my code:
<%@ Language="VBScript" %>
<% Option Explicit %>
<% Response.Buffer = True %>
<html>
<head>
<% 'Create Cookie on client computer to allow the site to recognise the prospective client
'Variables
Dim sname , fname , add1 , add2 , pcode , daytel , evetel
Dim mobtel , btoc , detreq , Con , SQL , Application
Dim ipRS
'Obtain information from form
fname=Replace(Request.Form("fname"
sname=Replace(Request.Form("sname"
add1=Replace(Request.Form("add1"
add2=Replace(Request.Form("add2"
pcode=Replace(Request.Form("pcode"
daytel=Replace(Request.Form("daytel"
evetel=Replace(Request.Form("evetel"
mobtel=Replace(Request.Form("mobtel"
btoc=Replace(Request.Form("btoc"
detreq=Replace(Request.Form("detreq"
'Set Cookie
Response.Cookies("ProspectiveCookie"
Response.Cookies("ProspectiveCookie"
Response.Cookies("ProspectiveCookie"
Response.Cookies("ProspectiveCookie"
Response.Cookies("ProspectiveCookie"
%>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "Providor=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("databases/pj.mdb"
'Insert record into the database
SQL = "INSERT INTO reginterest(fname , sname , add1 , add2 , pcode , daytel , evetel, mobtel , btoc , detreq)VALUES('"&fname&"','"&sname&"','"&add1&"','"&add2&"','"&pcode&"','"&daytel&"','"&evetel&"','"&mobtel&"','"&btoc&"','"&detreq&"')"
Set ipRS=Server.CreateObject("ADODB.Recordset"
ipRS.open SQL, con
MyConn.Close()
Set Conn = Nothing
response.write("done"
%>
</body>
</html>
thanx