一、GetRows的使用方法:
<%
Set conn=Server.CreateObject("Adodb.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("test.mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.Open "Select Top 2 * From 表名",conn,0,1
六、如何在不同页面间共享数组内容?
a.asp文件内容:
<%
Dim arr(5)
Dim str,i
'给数据赋值
For i= 0 to 5
arr(i)=i
Next
'传递数组
str=join(arr)
Response.Write "<a href=test.asp?tempstr="& str &">传送数组内容</a>"
%>
八、为什么在ADO访问数据库时使用事务会提示出错?
情况一:
set dbconn=server.createobject("adodb.connection")
set dbcmd=server.createobject("adodb.command")
dbconn.open "dsn=sqlforum;uid=sa;pwd=;"
dbconn.BeginTrans
Rs.Open "select * from message",dbconn
set dbcmd.activeconnection=dbconn
以上语句提示如下错误信息:
Unspecified error
情况二:
set dbconn=server.createobject("adodb.connection")
bconn.open "dsn=sqlforum;uid=sa;pwd=;"
dbconn.BeginTrans
以上语句提示如下信息:
Cannot start transaction while in firehose mode.
情况三:
set dbconn=server.createobject("adodb.connection")
set dbcmd=server.createobject("adodb.command")
dbconn.open "dsn=sqlforum;uid=sa;pwd=;"
rs.open "select * from message",dbconn
set dbcmd.activeconnection=dbconn
dbconn.BeginTrans
以上语句提示如下信息:
Cannot start transaction because more than one hdbc is in use.