asp中想插入2个access数据库,出现的数据库路径问题。请帮帮我这新手。最好说得详细一点,可加分
插入一个数据库的时候能正常显示,按同样方法插入第二个数据库的时候就报错。错误类型:MicrosoftJETDatabaseEngine(0x80040E37)Micros...
插入一个数据库的时候能正常显示,按同样方法插入第二个数据库的时候就报错。
错误类型:
Microsoft JET Database Engine (0x80040E37)
Microsoft Jet 数据库引擎找不到输入表或查询 'QQqianming'。 确定它是否存在,以及它的名称的拼写是否正确。
/index.asp, 第 27 行
QQqianming.mdb对应的是ccc.asp
ccc.asp的代码是:
<%
db="qqqianming.mdb" '-----相对路径--------
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(db)
conn.open connstr
%>
下面是主页代码,没有编程基础的新手,大家别笑话
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="ccc.asp" -->
<!--#include file="lianjie.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = connstr
Recordset1_cmd.CommandText = "SELECT t_a_biaoti, ID, t_a_riqi FROM joke"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows
Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = connstr
Recordset2_cmd.CommandText = "SELECT ID, mingzi, riqi FROM QQqianming"
Recordset2_cmd.Prepared = true
Set Recordset2 = Recordset2_cmd.Execute 这是第27行
Recordset2_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 9
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = 9
Repeat2__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat2__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
。。。。。。。。 展开
错误类型:
Microsoft JET Database Engine (0x80040E37)
Microsoft Jet 数据库引擎找不到输入表或查询 'QQqianming'。 确定它是否存在,以及它的名称的拼写是否正确。
/index.asp, 第 27 行
QQqianming.mdb对应的是ccc.asp
ccc.asp的代码是:
<%
db="qqqianming.mdb" '-----相对路径--------
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(db)
conn.open connstr
%>
下面是主页代码,没有编程基础的新手,大家别笑话
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="ccc.asp" -->
<!--#include file="lianjie.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = connstr
Recordset1_cmd.CommandText = "SELECT t_a_biaoti, ID, t_a_riqi FROM joke"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows
Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = connstr
Recordset2_cmd.CommandText = "SELECT ID, mingzi, riqi FROM QQqianming"
Recordset2_cmd.Prepared = true
Set Recordset2 = Recordset2_cmd.Execute 这是第27行
Recordset2_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 9
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = 9
Repeat2__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat2__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
。。。。。。。。 展开
展开全部
<%
db="joke.mdb" '-----相对路径--------
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(db)
conn.open connstr
%>
conn与connstr换成别的名字,不要与ccc.asp里的重名就好了,这样要用哪个数据库就用那个对象
db="joke.mdb" '-----相对路径--------
set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(db)
conn.open connstr
%>
conn与connstr换成别的名字,不要与ccc.asp里的重名就好了,这样要用哪个数据库就用那个对象
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询