标题:能 同时用几个数据集读数据库么
只看楼主
lzxm160
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2006-12-26
 问题点数:0 回复次数:2 
能 同时用几个数据集读数据库么
Dim MM_conn_STRING
MM_conn_STRING = "Driver=Microsoft Access Driver (*.mdb);DBQ="&server.mappath("news.mdb")'数据库连接字符串
%>

<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "0"
If (Request("MM_EmptyValue") <> "") Then
  Recordset1__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM type WHERE typeid > " + Replace(Recordset1__MMColParam, "'", "''") + " ORDER BY typeid DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()


<!-- #include file="inc_connect.asp"-->

    function getp(ps)
    sql="Select count(id) from Candidate where ps>"&ps
    Set ts=cnn.execute(sql)
    getp=ts(0)+1
    end function
    '============================================建立数据集rs_vote  链接字符串
    Set rs_vote = Server.CreateObject("ADODB.Recordset")
    rsstring_vote = "SELECT id,name,rq,college,photo,ps from Candidate where ps in (SELECT max(ps) from Candidate Group by t_group)"

    rs_vote.Open rsstring_vote,cnn,3,4 此行出错
    if not rs_vote.eof then
    %>

报错
ADODB.Recordset 错误 '800a0e7d'

连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
搜索更多相关主题的帖子: 数据库 数据集 
2008-10-04 09:46
duanchangren2
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2008-10-3
得分:0 

事在人为```
2008-10-04 09:54
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1246
专家分:1909
注 册:2007-6-4
得分:0 
rs_vote.Open rsstring_vote,cnn,3,4 改成
rs_vote.Open rsstring_vote,cnn,1,3 试试!
2008-10-04 14:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-236311-1-1.html




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

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