研究rds的困惑

类别:软件工程 点击:0 评论:0 推荐:

rds这个东西我是在一篇关于在asp中生成报表的文章中见到的,但是我始终也没有明白它是干什么的,因为我做了无数次的测试,查了无数的资料,还是不能完成一个最简单的测试程序。

下面的程序(从别人哪里抄来改的)只要一执行Set rs = df.Query(strCn, strSQL)
就说服务器错误,真的让我困惑,决定今后不再研究它了。

《DIV align=left〉
《INPUT language=vbscript style="WIDTH: 90px; HEIGHT: 32px" onclick=fun_query() type=button value="Query Data" name=query〉
《INPUT language=vbscript style="WIDTH: 90px; HEIGHT: 32px" onclick=fun_clear() type=button value="Clear Data" name=Clear〉
《INPUT language=vbscript style="WIDTH: 90px; HEIGHT: 32px" onclick=fun_excel() type=button value="Excel Report" name=report〉
《DIV〉 《DIV id=adddata〉《/DIV〉《/FORM〉
《SCRIPT language=vbscript〉
set conn=createobject("adodb.connection")
set rr=createobject("adodb.recordset")
conn.Open "dsn=sqls;uid=sa;pwd=myself"
rr.Open "select * from jobs",conn,3,1
msgbox rr.Fields(0)
dim rds,rs,df
dim strSQL,StrRs,strCn,RowCnt
dim xlApp, xlBook, xlSheet1,xlmodule,XlPageSetup
dim HeadRowCnt,TitleRowCnt,ContentRowCnt,FootRowCnt
dim PageRowCnt,PageNo,TotalPageCnt,ContentRowNowCnt
dim ColumnAllWidth,ColumnAWidth,ColumnBWidth,ColumnCWidth,ColumnDWidth sub fun_query()
set rds = CreateObject("RDS.DataSpace")?
Set df = rds.CreateObject("RDSServer.DataFactory","http://192.168.22.205") strCn="dsn=sqls;uid=sa;pwd=myself"
strSQL = "Select * from jobs"
Set rs = df.Query(strCn, strSQL)
‘set rs=rr
if not rs.eof then
StrRs="《TABLE border=1〉《TBODY〉《TR〉《TD〉job_id《 TD〉job_desc《/TD〉《TD〉max_lvl《TD〉min_lvl《TR〉《TD〉"+rs.GetString(,,"《TD〉","《TR〉《TD〉"," ") +""
adddata. innerHTML=StrRs
StrRs=""
else
msgbox "No data in the table!"
end if
set df=nothing
end sub
《/SCRIPT〉

本文地址:http://com.8s8s.com/it/it36068.htm