研究rds的困惑

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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〉

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航