|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。程序|数据|数据库|数据库毗连我历来就不必DNS毗连,我以为谁人很不便利,上面这部分程序可说是全能的数据库毗连程序几近能够毗连一切的MS数据库,本人拿往研讨吧(这个程序是“ASP网页制造教程”这本书内里的――一本好书):
<%
---------------------------------------------------
FunctionGetMdbConnection(FileName)
DimProvider,DBPathProvider="Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath="DataSource="&Server.MapPath(FileName)
SetGetMdbConnection=GetConnection(Provider&DBPath)
EndFunction---------------------------------------------------
FunctionGetSecuredMdbConnection(FileName,Password)
DimProvider,DBPathProvider="Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath="DataSource="&Server.MapPath(FileName)
SetGetSecuredMdbConnection=GetConnection(Provider&DBPath&";JetOLEDB:DatabasePassword="&Password)
EndFunction---------------------------------------------------
FunctionGetDbcConnection(FileName)
DimDriver,SourceType,DBPathDriver="Driver={MicrosoftVisualFoxProDriver};"
SourceType="SourceType=DBC;"
DBPath="SourceDB="&Server.MapPath(FileName)
SetGetDbcConnection=GetConnection(Driver&SourceType&DBPath)
EndFunction---------------------------------------------------
FunctionGetDbfConnection(Directory)
DimDriver,SourceType,DBPathDriver="Driver={MicrosoftVisualFoxProDriver};"
SourceType="SourceType=DBF;"
DBPath="SourceDB="&Server.MapPath(Directory)
SetGetDbfConnection=GetConnection(Driver&SourceType&DBPath)
EndFunction---------------------------------------------------
FunctionGetExcelConnection(FileName)
DimDriver,DBPathDriver="Driver={MicrosoftExcelDriver(*.xls)};"
DBPath="DBQ="&Server.MapPath(FileName)
SetGetExcelConnection=GetConnection(Driver&"ReadOnly=0;"&DBPath)
EndFunction---------------------------------------------------
FunctionGetTextConnection(Directory)
DimDriver,DBPathDriver="Driver={MicrosoftTextDriver(*.txt;*.csv)};"
DBPath="DBQ="&Server.MapPath(Directory)
SetGetTextConnection=GetConnection(Driver&DBPath)
EndFunction---------------------------------------------------
FunctionGetSQLServerConnection(Computer,UserID,Password,Db)
DimParams,connSetGetSQLServerConnection=Nothing
Params="Provider=SQLOLEDB.1"
Params=Params&";DataSource="&Computer
Params=Params&";UserID="&UserID
Params=Params&";Password="&Password
Params=Params&";InitialCatalog="&Db
Setconn=Server.CreateObject("ADODB.Connection")
conn.OpenParams
SetGetSQLServerConnection=conn
EndFunction---------------------------------------------------
FunctionGetMdbRecordset(FileName,Source)
SetGetMdbRecordset=GetMdbRs(FileName,Source,2,"")
EndFunction---------------------------------------------------
FunctionGetMdbStaticRecordset(FileName,Source)
SetGetMdbStaticRecordset=GetMdbRs(FileName,Source,3,"")
EndFunction---------------------------------------------------
FunctionGetSecuredMdbRecordset(FileName,Source,Password)
SetGetSecuredMdbRecordset=GetMdbRs(FileName,Source,2,Password)
EndFunction---------------------------------------------------
FunctionGetSecuredMdbStaticRecordset(FileName,Source,Password)
SetGetSecuredMdbStaticRecordset=GetMdbRs(FileName,Source,3,Password)
EndFunction---------------------------------------------------
FunctionGetDbfRecordset(Directory,SQL)
SetGetDbfRecordset=GetOtherRs("Dbf",Directory,SQL,2)
EndFunction---------------------------------------------------
FunctionGetDbfStaticRecordset(Directory,SQL)
SetGetDbfStaticRecordset=GetOtherRs("Dbf",Directory,SQL,3)
EndFunction---------------------------------------------------
FunctionGetDbcRecordset(FileName,SQL)
SetGetDbcRecordset=GetOtherRs("Dbc",FileName,SQL,2)
EndFunction---------------------------------------------------
FunctionGetDbcStaticRecordset(FileName,SQL)
SetGetDbcStaticRecordset=GetOtherRs("Dbc",FileName,SQL,3)
EndFunction---------------------------------------------------
FunctionGetExcelRecordset(FileName,SQL)</p>asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了! |
|