| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 740 人关注过本帖
标题:[求助] asp和数据库的连接问题
只看楼主 加入收藏
soph
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-6-26
收藏
 问题点数:0 回复次数:9 
[求助] asp和数据库的连接问题

Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0x36c Thread 0x6e0 DBC 0x2215bec Jet'。

/wenxue/data/index.asp,行8

搜索更多相关主题的帖子: 数据库 Microsoft asp Jet 
2007-06-30 09:20
enlangs
Rank: 1
等 级:等待验证会员
威 望:2
帖 子:218
专家分:0
注 册:2007-5-28
收藏
得分:0 
初步判定是你少了End If之类.


贴全部代码出来.
2007-06-30 09:25
soph
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-6-26
收藏
得分:0 

补充一下

<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_liu_STRING
Recordset1.Source = "SELECT * FROM main ORDER BY id ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
Recordset1.ActiveConnection = MM_liu_STRING 这个是第八行

下边这个是connection中的liu.asp中的内容

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_liu_STRING
MM_liu_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\文学天地\wenxue\data\data.mdb"
%>


[此贴子已经被作者于2007-6-30 9:38:37编辑过]


2007-06-30 09:27
enlangs
Rank: 1
等 级:等待验证会员
威 望:2
帖 子:218
专家分:0
注 册:2007-5-28
收藏
得分:0 
全部........
2007-06-30 09:34
soph
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-6-26
收藏
得分:0 

这个是index.asp中的所有代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../Connections/liu.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_liu_STRING
Recordset1.Source = "SELECT * FROM main ORDER BY id ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>留言板主页</title>
</head>

<body>
<table width="650" height="381" border="1" align="center" cellpadding="0" cellspacing="0" id="table1">
<tr>
<td height="15" colspan="2" align="center" valign="middle" nowrap="nowrap">我的留言板</td>
</tr>
<tr>
<td height="15" colspan="2" align="right"><a href="insert.asp">留言</a> <a href="index.asp">查看</a> <a href="login.asp">管理</a></td>
</tr>
<tr>
<td width="92" height="312" align="left"><table width="92" height="315" border="1" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="88" height="279"><img src="../image/touxiang/1-3.gif" width="97" height="90" /></td>
</tr>
<tr>
<td height="34" align="center">访客昵称</td>
</tr>
</table></td>
<td width="552" align="left"><table width="100%" height="317" border="1" cellpadding="0" cellspacing="0" id="table2">
<tr>
<td height="19">访客发表于:2006-4-10 10-15-20 </td>
</tr>
<tr>
<td><table width="100%" height="267" border="1" cellpadding="0" cellspacing="0" id="table3">
<tr>
<td width="9%" height="97" align="center" valign="middle">留言</td>
<td width="91%">留言内容</td>
</tr>
<tr>
<td height="86" align="center" valign="middle">回复</td>
<td>回复内容</td>
</tr>
</table></td>
</tr>
<tr>
<td height="27" align="right" valign="middle">主页 信箱 QQ</td>
</tr>
</table></td>
</tr>
<tr>
<td height="15" colspan="2" align="right">首页 上页 下页 尾页</td>
</tr>
<tr>
<td height="15" colspan="2" align="center">&nbsp;</td>
</tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
这个是liu.asp中的所有代码
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_liu_STRING
MM_liu_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\文学天地\wenxue\data\data.mdb"
%>



2007-06-30 09:51
enlangs
Rank: 1
等 级:等待验证会员
威 望:2
帖 子:218
专家分:0
注 册:2007-5-28
收藏
得分:0 

重新发下代码.在乱了..

2007-06-30 09:56
soph
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-6-26
收藏
得分:0 

<!--#include file="../../Connections/liu.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_liu_STRING
Recordset1.Source = "SELECT * FROM main ORDER BY id ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_liu_STRING
MM_liu_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\文学天地\wenxue\data\data.mdb"
%>

这是动态部分的所有代码,剩下的都是静态的和数据库没有关系

上边的错误是连接完数据库出现的


2007-06-30 10:41
恒天
Rank: 1
等 级:新手上路
威 望:2
帖 子:165
专家分:0
注 册:2007-6-1
收藏
得分:0 
代码太乱了,看的眼花
2007-06-30 10:42
soph
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-6-26
收藏
得分:0 
你说 能力不行我可以接受的,呵呵

2007-06-30 11:24
恒天
Rank: 1
等 级:新手上路
威 望:2
帖 子:165
专家分:0
注 册:2007-6-1
收藏
得分:0 
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
放到最下面看看
2007-06-30 11:34
快速回复:[求助] asp和数据库的连接问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017367 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved