ASPÁ¬½ÓÊý¾Ý¿âµÄÈ«ÄÜ´úÂë
aspÁ¬½ÓaccessºÍmssqlµÄÍòÄÜ´úÂ룺
'½â¾öÁËACCESSÊý¾Ý¿â·¾¶µÄÎÊÌ⣡
'²ÉÓÃDBType=0»òDBType=1À´Çø·ÖAC¿â»¹ÊÇMSSQL¿â
'¾ßÌå²ÉÓÃAC¿âʱӦעÒâµÄÊÂÏÇë¿´³ÌÐò˵Ã÷
-----------------------------------------------
Dim DBType,Conn,StrConn
DBType=0 '0ΪAccessÊý¾Ý¿â£¬1ΪMSSQLÊý¾Ý¿â
If(DBType=0) Then
'****************ACCESSÊý¾Ý¿â******************
Dim DbFolderName,DbFolder_Path,SiteFolder
DbFolderName="ArticleData" 'Êý¾Ý¿âËùÔÚÎļþ¼ÐÃû³Æ
DbFolder_Path = Server.MapPath(DbFolderName) 'Êý¾Ý¿âËùÔÚ·¾¶
SiteFolder="Article" 'ϵͳËùÔÚ¸ùĿ¼Ãû³Æ
If Session("RootDir") = "" Then
Session("RootDir") = Mid(DbFolder_Path, 1, InStr(1,DbFolder_Path,SiteFolder,1) -1) & SiteFolder
End if
Set Conn = Server.CreateObject("Adodb.Connection")
StrConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Session("RootDir") & "\"& DbFolderName & "\Data.mdb" 'Á¬½Óµ½Êý¾Ý¿â
Conn.Open StrConn
'**************************************************
ElseIf(DBType=1) Then
'*****************MSSQL SERVERÊý¾Ý¿â******
Dim DBUserID,DBPassWord,DBName,DBIP
'ÐÞ¸ÄÒÔÏÂÐÅÏ¢ÒÔÊʺÏÄãµÄÍøÕ¾
DBUserID="sa" 'Êý¾Ý¿âµÇ½Ãû
DBPassWord="" 'Êý¾Ý¿âÃÜÂë
DBName="dbname" 'Êý¾Ý¿âÃû³Æ
DBIP="local" 'Êý¾Ý¿âËùÔÚµØÖ·£¬Èç¹ûÊDZ¾µØÊý¾Ý¿âÔòΪ£º(local)
Set Conn=Server.CreateObject("Adodb.Connection")
StrConn = "PROVIDER=SQLOLEDB.1;Data Source="&DBIP&";Initial Catalog="&DBName&";Persist Security Info=True;User ID="&DBUserID&";Password="&DBPassWord&";Connect Timeout=30"
Conn.Open StrConn
'******************************************************
Else
'***********************Êý¾Ý¿âÉèÖôíÎó*****************
Response.Write"Êý¾Ý¿âÉèÖôíÎó£¬ÇëÁªÏµ¹ÜÀíÔ±£¡"
Response.End
End If
'Response.Write StrConn
Ïà¹ØÎĵµ£º
1¡¢ÔÚÍøվĿ¼ÏÂн¨Ò»¸öÎı¾£ºtxtcounter.txt ÔÚÎı¾Ìîд1»òÆäËûʶ×Ö
2¡¢Ð½¨Ò»aspÎļþ£ºcount.asp£¬¼ÓÈëÒÔÏ´úÂ룺
<%
CountFile=Server.MapPath("txtcounter.txt")
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountF ......
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder("c:\Program Files")
Response.Write "¸¸Îļþ¼ÐÃû×ÖÊÇ£º" & fldr & "<br>"
If fldr.IsRootFolder = True Then
Response.Write "¸ÃÎļþ¼ÐÊÇÒ»¸ùÎļþ¼Ð" & "<br>"
Else
Resp ......
´ó¼ÒÓÐÅöµ½¹ýÒªÏëÈ¡Ò»×Ö·û´®ÀïµÄijЩֵ¶øÎÞ´ÓÏÂÊÖ£¿ÓÐûÓоõµÃ¿´Êé»ò½Ì²Ä¶ÔsplitµÄд·¨ºýÀïºýÍ¿……Èç¹ûÓдËÒÉÎʵĻ°£¬Çë¿´ÏÂÃæÎÒ¶ÔÀý×ӵĽâÊÍ£¬ÏàÐÅÄú»á¶ÔÕâ¸öÓÐÒ»¶¨µÄÁ˽⡣
ÎÒÏȽéÉÜÒ»ÏÂSplitº¯ÊýµÄÓ÷¨:
·µ»ØÖµÊý×é = Split("×Ö·û´®","·Ö¸î·û")
¼ÙÉè±äÁ¿strURL±£´æ×ÅURLÖµ£¬ÈçstrURL = "ftp://username ......
ODBCÊý¾ÝÔ´¿É·ÖΪ“ϵͳÐÍ”ºÍ“ÎļþÐÍ”£¬ËûÃǵÄÇø±ðÔÚÓړϵͳÐÍ”ÊÇÁ¬½ÓÊý¾Ý¿âµÄÐÅÏ¢½¨Á¢Ôړϵͳע²á±í”À“ÎļþÐÍ”ÔòÊÇÒÔdsnÎļþÐÎʽ´æ´¢ÔÚODBCÔ´µÄĿ¼ÏÂÃæ
Ò»¡¢½¨Á¢ODBCÊý¾ÝÔ´µÄ·½·¨£º
¿ØÖÆÃæ°å - ¹ÜÀí¹¤¾ß - Êý¾ÝÔ´£¨ODBC£©
´ò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¬È»ºóÒ ......
Ê×ÏÈ£¬ËûÃǵÄÔËÐлúÖƲ»Í¬¡£aspÊÇÊôÓÚÒ»ÖÖ½âÊÍÐ͵Ŀò¼Ü£¡ÊǽâÊÍÖ´Ðеģ¬Êǽű¾¡£asp.netÊDZàÒëÐ͵ģ¡×îÖÕ»á±à³Ì¶þ½øÖƵĻúÆ÷´úÂë¡£´ÓÕâÒ»µãÀ´Ëµ£¬asp.netÖ´ÐÐЧÂÊÉÏÒª±Èasp¸ß£¡
Æä´Î£¬aspÖ»ÔÊÐíʹÓÃjs»òÕßvbs¡£¶øasp.netÔò²»Ò»Ñù£¬Ö»Òª·ûºÏ¹«¹²ÓïÑÔÔËÐпâ¹æ·¶µÄÓïÑÔ£¬¶¼¿ÉÒÔʹÓã¡´ÓÕâÒ»µãÉÏÀ´Ëµ£¬aspÔڵײã²Ù×÷ÉϽÏasp.ne ......