注册 登录
编程论坛 ASP技术论坛

[求助]ActiveConnection属性

lzlcn 发布于 2007-08-08 19:36, 699 次点击

<%
Dim ggrs
Dim ggrs_numRowsSet ggrs = Server.CreateObject("ADODB.Recordset")
ggrs.ActiveConnection = MM_conn_STRING
ggrs.Source = "SELECT id, txt FROM gonggao ORDER BY id ASC"
ggrs.CursorType = 0
ggrs.CursorLocation = 2
ggrs.LockType = 1
ggrs.Open()

ggrs_numRows = 0
%>
请问这段程序是什么意思,谢谢 !

5 回复
#2
yms1232007-08-08 19:45

<%
Dim ggrs
Dim ggrs_numRows
Set ggrs = Server.CreateObject("ADODB.Recordset")
ggrs.ActiveConnection = MM_conn_STRING
ggrs.Source = "SELECT id, txt FROM gonggao ORDER BY id ASC"
ggrs.CursorType = 0
ggrs.CursorLocation = 2
ggrs.LockType = 1
ggrs.Open()

ggrs_numRows = 0
%>
请问这段程序是什么意思,谢谢 !
这段程序是打开记录集的代码,从程序上看很像Dreamweaver生成的代码。

#3
lzlcn2007-08-08 20:04
我运行这一页时,提示ggrs.ActiveConnection = MM_conn_STRING有错,请问这句是什么意思???
#4
盖世豪侠2007-08-08 20:25

ggrs.ActiveConnection = MM_conn_STRING
这句话是定义RECORDSET对象所使用的数据资源连接

你找一下
set MM_conn_STRING=server.createobject("adodb.connection")
MM_conn_STRING.open"....................."

#5
yuan01212007-08-27 09:30

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

[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败

/main.asp,行 8

<%
Dim fromcitylist
Dim fromcitylist_numRows

Set fromcitylist = Server.CreateObject("ADODB.Recordset")
fromcitylist.ActiveConnection = MM_naer_STRING-------------------------------------- 第八行
fromcitylist.Source = "SELECT distinct xilie FROM sbsj"
fromcitylist.CursorType = 0
fromcitylist.CursorLocation = 2
fromcitylist.LockType = 1
fromcitylist.Open()

fromcitylist_numRows = 0
%>
想问问 哪里出了问题啊

#6
yms1232007-08-27 09:45
以下是引用yuan0121在2007-8-27 9:30:53的发言:

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

[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败

/main.asp,行 8

<%
Dim fromcitylist
Dim fromcitylist_numRows

Set fromcitylist = Server.CreateObject("ADODB.Recordset")
fromcitylist.ActiveConnection = MM_naer_STRING-------------------------------------- 第八行
fromcitylist.Source = "SELECT distinct xilie FROM sbsj"
fromcitylist.CursorType = 0
fromcitylist.CursorLocation = 2
fromcitylist.LockType = 1
fromcitylist.Open()

fromcitylist_numRows = 0
%>
想问问 哪里出了问题啊

MM_naer_STRING这个连接对象可能有问题,但楼主没有给连接对象创建的源代码。

1