|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp可以使用微软的activeX使得网页功能无比强大,不过安全性也较差,而且是基于的windows服务器,所以性能稳定性也一般存储历程|数据|数据库|显现
ItsnoeasytricktoseestoredproceduresinadatabaseprogrammaticallywithascriptinglanguagelikeASP.IfyoureusingMSAccess,youreoutofluck.AccessprovidesnowaytoseetheactualmeatofastoredprocedurealthoughyoucangetthenamesoftheproceduresinthedatabasewiththeADOX.CatalogCOMobject.
But,ifyouareusingSQLServer(likeyoushouldbebecauseyoucareaboutyourdata),youhaveaguaranteedwaytoviewallyourstoredproceduresusingtwoglobally-availablesystemobjects:thebuilt-insysobjectssystemtableandthesp_helptextsystemstoredprocedure.
Withacoupleofsimpleloops,everythingaboutyourstoredprocedurescanbeviewedandaccessedprogrammaticallyinjustafewlines.Herestheresultsofthefunction(Imallowingyoutoviewthefirstfewproceduresonlybecausethismethodcanbeprettyresource-intensive.IfyouwantthecompletelistofproceduresIuseonthissite,youcangetithere.)Hereshowitlookswhencalled:
CREATEPROCEDUREsp_addAdvertLink
(
@m1DateTime,
@m2DateTime,
@m3VarChar(20),
@m4VarChar(20),
@m5VarChar(255),
@m6VarChar(255),
@m7VarChar(255),
@m8VarChar(255)
)
AS
INSERTINTO
easyAds
(
display_date,display_time,display_month,display_day,
usr_ip_address,usr_browser,display_adName,usr_referer
)
VALUES
(
@m1,@m2,@m3,@m4,@m5,@m6,@m7,@m8
)
CREATEPROCEDUREsp_AddMailRecip
(
@mIPAddrVarChar(255),
@mEmailAddrVarChar(255)
)
AS
INSERTINTO
autoResponder
(
IPaddress,emailAddress
)
VALUES
(
@mIPAddr,@mEmailAddr
)
CREATEPROCEDUREsp_addUsrAddr
(
@mUsrVarChar(255),
@mFstNmeVarChar(255),
@mLastNmeVarChar(255),
@mAddr1VarChar(255),
@mAddr2VarChar(255),
@mcityVarChar(255),
@mstateVarChar(255),
@mzipVarChar(255),
@mEmailVarChar(255),
@mphoneVarChar(255),
@mfaxVarChar(255),
@mcellVarChar(255),
@mnotesText
)
AS
INSERTINTO
dayPlannerAddresses
(
usr,firstname,lastname,streetAddress1,streetAddress2,
city,state,zip,eMailAddress,phone,fax,cell,notes
)
VALUES
(
@mUsr,@mFstNme,@mLastNme,@mAddr1,@mAddr2,@mcity,@mstate,
@mzip,@mEmail,@mphone,@mfax,@mcell,@mnotes
)
------------------sysobjects.asp-------------源程序--------------
<%@Language=JScript%>
<%
with(Response){
Buffer=true;
Expires=0;
Clear();
}
functionShowProcs(){
//set-updatabaseconnectioninformation
varConnString=Application("dbConn");
varConnUser=Application("dbUsr");
varConnPass=Application("dbPass");
//setthisnextvariabletofalsetounrestrictthesystem
varLimitResults=true;
varMagicNumber=2;
//getaconnection
varc=newActiveXObject("ADODB.Connection");
//opendatabase
c.Open(ConnString,ConnUser,ConnPass);
//enableerror-trapping
try{
//attempttoaccessthesysobjectstable.
//ifyoutrythiswithMSAccess,youwillgetanerror...
//sysobjectstablecontainsinformationabouteverything
//inyourdatabase.Fromtablestoviews,andwhateverin
//between,allthatstuffisinthesysobjectstable.
//inmydb,astatusof24indicatesthatitsaprocedure
//thatIaddedandnotoneoftheotherbizarrestoredprocedures
//thatweremixedinthereaswell.AtypeofPindicatesStoredProcedure.
//OthervaluesfortypecanbeUforusertables,Rforrule,
//sforsystemtables(likesysobjects),TRfortriggers,Vforview,//etc...InthiscasePistheonewewant.
varp=c.Execute("SELECTNameFROMsysobjectsWHEREstatus=24ANDtype=PORDERBYName;");
}catch(e){
//oops-sysobjectstablenotfound.YoumustbeusingMSAccess.
//Oryouforgottore-codetheconnectionstring.
Response.Write("Thisexampleonlyworkswith<B>SQLServer");
Response.Write("</B>."sysobjects"tabledoesnotexist!<BR><BR>");
Response.Write("IfyouareusingSQLserver,youmayneedto");
Response.Write("adjusttheConnString,ConnUs</p>我想详细了解ASP整站代码与PSP整站代码有什么优缺点,那个更好,更安全,更用容易维护,和管理。。。 |
|