|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
大家可以自己去看一看.可以说看得想呕吐.以前有次下了个动网来看.里面连基本内置函数的保护措施(函数没防御性)都没有.难怪经常补这个补那个了.可能现在.NET版会好点吧程序|数据|数据库|数据库毗连---------------------------------------------------
FunctionGetExcelRecordset(FileName,SQL)
SetGetExcelRecordset=GetOtherRs("Excel",FileName,SQL,2)
EndFunction
---------------------------------------------------
FunctionGetExcelStaticRecordset(FileName,SQL)
SetGetExcelStaticRecordset=GetOtherRs("Excel",FileName,SQL,3)
EndFunction
---------------------------------------------------
FunctionGetTextRecordset(Directory,SQL)
SetGetTextRecordset=GetOtherRs("Text",Directory,SQL,2)
EndFunction
---------------------------------------------------
FunctionGetTextStaticRecordset(Directory,SQL)
SetGetTextStaticRecordset=GetOtherRs("Text",Directory,SQL,3)
EndFunction
---------------------------------------------------
FunctionGetSQLServerRecordset(conn,source)
Dimrs
Setrs=Server.CreateObject("ADODB.Recordset")
rs.Opensource,conn,2,2
SetGetSQLServerRecordset=rs
EndFunction
---------------------------------------------------
FunctionGetSQLServerStaticRecordset(conn,source)
Dimrs
Setrs=Server.CreateObject("ADODB.Recordset")
rs.Opensource,conn,3,2
SetGetSQLServerStaticRecordset=rs
EndFunction
---------------------------------------------------
FunctionGetConnection(Param)
Dimconn
OnErrorResumeNext
SetGetConnection=Nothing
Setconn=Server.CreateObject("ADODB.Connection")
IfErr.Number0ThenExitFunction
conn.OpenParam
IfErr.Number0ThenExitFunction
SetGetConnection=conn
EndFunction
---------------------------------------------------
FunctionGetMdbRs(FileName,Source,Cursor,Password)
Dimconn,rs
OnErrorResumeNext
SetGetMdbRs=Nothing
IfLen(Password)=0Then
Setconn=GetMdbConnection(FileName)
Else
Setconn=GetSecuredMdbConnection(FileName,Password)
EndIf
IfconnIsNothingThenExitFunction
Setrs=Server.CreateObject("ADODB.Recordset")
IfErr.Number0ThenExitFunction
rs.Opensource,conn,Cursor,2
IfErr.Number0ThenExitFunction
SetGetMdbRs=rs
EndFunction
---------------------------------------------------
FunctionGetOtherRs(DataType,Path,SQL,Cursor)
Dimconn,rs
OnErrorResumeNext
SetGetOtherRs=Nothing
SelectCaseDataType
Case"Dbf"
Setconn=GetDbfConnection(Path)
Case"Dbc"
Setconn=GetDbcConnection(Path)
Case"Excel"
Setconn=GetExcelConnection(Path)
Case"Text"
Setconn=GetTextConnection(Path)
EndSelect
IfconnIsNothingThenExitFunction
Setrs=Server.CreateObject("ADODB.Recordset")
IfErr.Number0ThenExitFunction
rs.OpenSQL,conn,Cursor,2
IfErr.Number0ThenExitFunction
SetGetOtherRs=rs
EndFunction
---------------------------------------------------
FunctionGetSQLServerRs(Computer,UserID,Password,Db,source,Cursor)
Dimconn,rs
OnErrorResumeNext
SetGetSQLServerRs=Nothing
Setconn=GetSQLServerConnection(Computer,UserID,Password,Db)
IfconnIsNothingThenExitFunction
Setrs=Server.CreateObject("ADODB.Recordset")
IfErr.Number0ThenExitFunction
rs.Opensource,conn,Cursor,2
IfErr.Number0ThenExitFunction
SetGetSQLServerRs=rs
EndFunction
%>
利用办法是――复制上去存成一个文件,然后用#Include“文件名”就能够挪用内里的子程序了。ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。 |
|