开发者

Access database Connection string error in asp

I have created an asp feedback web page this page connect with the access database when I run this page every thing is ok until I click to submit button When I click submit button it gives error like

and here is my asp code开发者_开发知识库

<%   
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString =Provider=Microsoft.Jet.OLEDB.4.0;
 Data Source="Server.MapPath("/MyData.mdb")

objConn.Open
%>
<%
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "tblContact",objConn,adLockOptimistic,adCmdTable
objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("FirstName") = Request.Form("FirstName")
objRS("LastName") = Request.Form("LastName")
objRS("Comments") = Request.Form("Comments")
objRS("DateContacted") = Date()
objRS.Update
%>

<%
DIM strFirstName
strFirstName = Request.Form("FirstName")
%>

<%
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%> 


Update

objConn.ConnectionString =Provider=Microsoft.Jet.OLEDB.4.0;
 Data Source="Server.MapPath("/MyData.mdb")

with

objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/MyData.mdb")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜