初手有一个很小的问题,请教大家

wukunrong 2002-07-31 04:13:11
好不容易自己做了一个简单的留言版,可是测试的时候输入http://localhost页面打不开,出现以下内容,请解决。
________________________
本页无法显示
试图访问的网页出现问题,无法显示。

请尝试以下方法:

单击 刷新按钮或者梢候再试。

打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务

技术信息(适用于支持人员)

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/index.asp, 第 27 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)

页:
GET /index.asp

时间:
2002年7月31日, 13:50:44


详细信息:
Microsoft 支持
_-------------------
其中 Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
是什么错误?是不是我没联上数据库?应该怎么办?
...全文
36 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
wukunrong 2002-08-05
  • 打赏
  • 举报
回复
我的路径没有问题,都一个文件夹里,而且以前我用过没有这种问题。是不是要重新装一下odbc,重装odbc是不是要重新下载?
wukunrong 2002-08-05
  • 打赏
  • 举报
回复
问题我的路径没有问题,都在一个文件夹里,是不是我应该重新建一下odbc里的数据库?以前我用的时候不会有这种问题的,重装odbc是不是要重新下载?
zrui 2002-08-05
  • 打赏
  • 举报
回复
我也在被这个问题烦,可能是 链接数据库出问题了.
1、检查一下存放数据库的路径;
2、重设一下ODBC数据源;
3、修复数据库。


wukunrong 2002-08-05
  • 打赏
  • 举报
回复
错误是这样的:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/TMP1c8ogckip.asp, 第 27 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)

页:
GET /TMP1c8ogckip.asp

时间:
2002年8月5日, 9:37:38 _____________
-----------------------------
27行是:
Recordset1.ActiveConnection = MM_recordset1_STRING;
如何解决?
antiking 2002-08-02
  • 打赏
  • 举报
回复
大部分ADO的错误码对应的含义? 

除了在 Error 对象和 Errors 集合中说明的提供者错误之外,ADO 本身也将错误返回到运行时环境的异常处理机制之中。使用编程语言的错误捕获机制(如 Microsoft® Visual Basic® 中的 On Error 语句)可捕获及处理下列错误。下表将同时显示十进制和十六进制错误代码值。

常量名称 编号 说明

adErrInvalidArgument 3001
0x800A0BB9
应用程序使用的参数其类型错误、超出可接受的范围或者与其他参数冲突。

adErrNoCurrentRecord 3021
0x800A0BCD
BOF 或 EOF 为 True,或者当前记录已经删除。应用程序请求的*作需要当前记录。


adErrIllegalOperation 3219
0x800A0C93
应用程序请求的*作不允许出现在该上下文中


adErrInTransaction 3246
0x800A0CAE
在事务中应用程序无法显式关闭 Connection 对象。


adErrFeatureNotAvailable 3251
0x800A0CB3
提供者不支持应用程序请求的*作。


adErrItemNotFound 3265
0x800A0CC1
ADO 无法在对应于应用程序请求的名称或顺序引用的集合中找到对象。


adErrObjectInCollection 3367
0x800A0D27
无法追加,对象已经在集合中。


adErrObjectNotSet 3420
0x800A0D5C
应用程序引用的对象不再指向有效的对象。


adErrDataConversion 3421
0x800A0D5D
应用程序使用了不符合对当前*作的值类型。


adErrObjectClosed 3704
0x800A0E78
如果对象关闭,则不允许应用程序请求的*作。


adErrObjectOpen 3705
0x800A0E79
如果对象打开,则不允许应用程序请求的*作。


adErrProviderNotFound 3706
0x800A0E7A
ADO 找不到指定的提供者。


adErrBoundToCommand 3707
0x800A0E7B
应用程序无法用 Command 对象将 Recordset 对象的 ActiveConnection 属性更改为它的来源数据。


adErrInvalidParamInfo 3708
0x800A0E7C
应用程序错误地定义了 Parameter 对象。


adErrInvalidConnection 3709
0x800A0E7D
应用程序通过引用关闭或无效的 Connection 对象来请求对对象的*作。

自己看吧,是什么错。

wukunrong 2002-08-01
  • 打赏
  • 举报
回复
不用接了,就这上面有问题,
DBPath = Server.MapPath("guest.mdb");
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath;
SQL="select * from auth where id='" & user_id &"'";
SET uplist=dbconnection.EXECUTE(SQL);
这段有错?错以哪呢?
wukunrong 2002-08-01
  • 打赏
  • 举报
回复
可是我已经连上数据库了啊。代码如下
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<%
// *** Logout the current user.set conn=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("guest.mdb");
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath;
SQL="select * from auth where id='" & user_id &"'";
SET uplist=dbconnection.EXECUTE(SQL);
MM_Logout = String(Request.ServerVariables("URL")) + "?MM_Logoutnow=1";
if (String(Request("MM_Logoutnow"))=="1") {
Session.Contents.Remove("MM_Username");
Session.Contents.Remove("MM_UserAuthorization");
var MM_logoutRedirectPage = "index.asp";
// redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage == "") MM_logoutRedirectPage = String(Request.ServerVariables("URL"));
if (String(MM_logoutRedirectPage).indexOf("?") == -1 && Request.QueryString != "") {
var MM_newQS = "?";
for (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) {
if (String(items.item()) != "MM_Logoutnow") {
if (MM_newQS.length > 1) MM_newQS += "&";
MM_newQS += items.item() + "=" + Server.URLencode(Request.QueryString(items.item()));
}
}
if (MM_newQS.length > 1) MM_logoutRedirectPage += MM_newQS;
}
Response.Redirect(MM_logoutRedirectPage);
}
%>
<!--#include file="../Connections/guest.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_guest_STRING;
Recordset1.Source = "SELECT * FROM f_bbs";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<%
var Repeat1__numRows = 14;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<%
// *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

// set the record count
var Recordset1_total = Recordset1.RecordCount;

// set the number of rows displayed on this page
if (Recordset1_numRows < 0) { // if repeat region set to all records
Recordset1_numRows = Recordset1_total;
} else if (Recordset1_numRows == 0) { // if no repeat regions
Recordset1_numRows = 1;
}

// set the first and last displayed record
var Recordset1_first = 1;
var Recordset1_last = Recordset1_first + Recordset1_numRows - 1;

// if we have the correct record count, check the other stats
if (Recordset1_total != -1) {
Recordset1_numRows = Math.min(Recordset1_numRows, Recordset1_total);
Recordset1_first = Math.min(Recordset1_first, Recordset1_total);
Recordset1_last = Math.min(Recordset1_last, Recordset1_total);
}
%>

<%
// *** Recordset Stats: if we don't know the record count, manually count them

if (Recordset1_total == -1) {

// count the total records by iterating through the recordset
for (Recordset1_total=0; !Recordset1.EOF; Recordset1.MoveNext()) {
Recordset1_total++;
}

// reset the cursor to the beginning
if (Recordset1.CursorType > 0) {
if (!Recordset1.BOF) Recordset1.MoveFirst();
} else {
Recordset1.Requery();
}

// set the number of rows displayed on this page
if (Recordset1_numRows < 0 || Recordset1_numRows > Recordset1_total) {
Recordset1_numRows = Recordset1_total;
}

// set the first and last displayed record
Recordset1_last = Math.min(Recordset1_first + Recordset1_numRows - 1, Recordset1_total);
Recordset1_first = Math.min(Recordset1_first, Recordset1_total);
}
%>

<% var MM_paramName = ""; %>
<%
// *** Move To Record and Go To Record: declare variables

var MM_rs = Recordset1;
var MM_rsCount = Recordset1_total;
var MM_size = Recordset1_numRows;
var MM_uniqueCol = "";
MM_paramName = "";
var MM_offset = 0;
var MM_atTotal = false;
var MM_paramIsDefined = (MM_paramName != "" && String(Request(MM_paramName)) != "undefined");
%>
<%
// *** Move To Record: handle 'index' or 'offset' parameter

if (!MM_paramIsDefined && MM_rsCount != 0) {

// use index parameter if defined, otherwise use offset parameter
r = String(Request("index"));
if (r == "undefined") r = String(Request("offset"));
if (r && r != "undefined") MM_offset = parseInt(r);

// if we have a record count, check if we are past the end of the recordset
if (MM_rsCount != -1) {
if (MM_offset >= MM_rsCount || MM_offset == -1) { // past end or move last
if ((MM_rsCount % MM_size) != 0) { // last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount % MM_size);
} else {
MM_offset = MM_rsCount - MM_size;
}
}
}

// move the cursor to the selected record
for (var i=0; !MM_rs.EOF && (i < MM_offset || MM_offset == -1); i++) {
MM_rs.MoveNext();
}
if (MM_rs.EOF) MM_offset = i; // set MM_offset to the last possible record
}
%>
<%
// *** Move To Record: if we dont know the record count, check the display range

if (MM_rsCount == -1) {

// walk to the end of the display range for this page
for (var i=MM_offset; !MM_rs.EOF && (MM_size < 0 || i < MM_offset + MM_size); i++) {
MM_rs.MoveNext();
}

// if we walked off the end of the recordset, set MM_rsCount and MM_size
if (MM_rs.EOF) {
MM_rsCount = i;
if (MM_size < 0 || MM_size > MM_rsCount) MM_size = MM_rsCount;
}

// if we walked off the end, set the offset based on page size
if (MM_rs.EOF && !MM_paramIsDefined) {
if ((MM_rsCount % MM_size) != 0) { // last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount % MM_size);
} else {
MM_offset = MM_rsCount - MM_size;
}
}

// reset the cursor to the beginning
if (MM_rs.CursorType > 0) {
if (!MM_rs.BOF) MM_rs.MoveFirst();
} else {
MM_rs.Requery();
}

// move the cursor to the selected record
for (var i=0; !MM_rs.EOF && i < MM_offset; i++) {
MM_rs.MoveNext();
}
}
%>
<%
// *** Move To Record: update recordset stats

下接
S.F. 2002-08-01
  • 打赏
  • 举报
回复
最怕看这样一大段的代码了。..
cshadow 2002-08-01
  • 打赏
  • 举报
回复
SQL="select * from auth where id=" & user_id

看看数据库中id的类型吧~是数字型,就这么改吧~~
Ebier 2002-07-31
  • 打赏
  • 举报
回复
打开数据库的参数错误,比如驱动程序呀,数据库服务器呀,用户权限等等,你可以把那段代码专门拿出来测试,能去出数据就行了。
wukunrong 2002-07-31
  • 打赏
  • 举报
回复
Recordset1.ActiveConnection = MM_guest_STRING;
这是27行啊,但我不知道有什么错误?一会把所有的贴出你们看看
deavey 2002-07-31
  • 打赏
  • 举报
回复
yao
JavaCoffee 2002-07-31
  • 打赏
  • 举报
回复
对,估计是你的数据库连接中有了问题。
你先在“ODBC管理器”中测试一下,看是否可以连上,然后再检查你的连接代码。下面是几个连接数据库的例子:

连接Sql Server数据库的标准方法
<%
Set myConn = Server.CreateObject("ADODB.Connection") 
strConn = "Provider=sqloledb; User ID=登录用户名; Password=该用户登录密码; Initial Catalog=数据库名称; Data Source=服务器IP地址" 
myConn.Open strConn
%>


ASP连接Access数据库的4种方法
1. 
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION") 
DBPath = Server.MapPath("customer.mdb") 
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath 
SQL="select * from auth where id='" & user_id &"'" 
SET uplist=dbconnection.EXECUTE(SQL) 
2. 
set dbconnection=Server.CreateObject("ADODB.Connection") 
DBPath = Server.MapPath("customer.mdb") 
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath 
SQL="select * from auth where id='" & user_id &"'" 
SET uplist=dbconnection.EXECUTE(SQL) 
3. 
DBPath = Server.MapPath("customer.mdb") 
set session("rs")=Server.CreateObject("ADODB.Recordset") 
' rs=Server.CreateObject("ADODB.Recordset") 
connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath 
SQL="select * from auth where id='" & user_id &"'" 
session("rs").Open sql,connstr,1,3 
4. 
建odbc源xxx 
set conn=server.createobject("Adodb.connection") 
conn.open "DSN=xxx;UID=;PWD=;Database=customer 
Jeroki 2002-07-31
  • 打赏
  • 举报
回复
/index.asp, 第 27 行!有错啊!要不把代码铁出来看看
MeXP 2002-07-31
  • 打赏
  • 举报
回复
肯定是有错误,但是什么错,把代码帖出来就知道了

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧