¶¯Ì¬ÍøÒ³¿ª·¢——ASPÁ¬½ÓSQL2005Êý¾Ý¿â
¶¯Ì¬ÍøÒ³¿ª·¢——ASPÁ¬½ÓSQL2005Êý¾Ý¿â
˵Ã÷£ºa¡¢ÒÔÏÂ×Ö·ûÖÐÊý¾Ý¿âÃûforum£¬Êý¾Ý¿â·þÎñÆ÷ÃûWWW-2443D34E558\SQL2005£¨»òÕß127.0.0.1£©
b¡¢²é¿´sqlÊý¾Ý¿â·þÎñÆ÷Ãû³Æ£º¶ÔÏó×ÊÔ´¹ÜÀíÆ÷->Êý¾Ý¿â->ÓÒ¼üµã»÷×Ô¼º½¨µÄÊý¾Ý¿â->ÊôÐÔ->ȨÏÞ
c¡¢Provider=sqlncliÒ²¿ÉÒÔ,UIDÓë“=”Ö®¼ä²»¿ÉÒÔÓпոñ£¬Èç¹û»»ÓÃuser id¾Í¿ÉÒÔÓÐ
¿Õ¸ñ£¬Initial Catalog¿ÉÒÔ»»ÓÃdatabase£¬pwd¿ÉÒÔ»»ÓÃpassword£¬data source¿ÉÒÔ»»ÓÃserver£¬
ÔÚVBScriptÖУ¬²»Çø·Ö´óСд£¬Òò´ËUIDµÈͬuidµÈͬUid¡£¡£¡££¬ÆäÖÐprovider¡¢uid¡¢pwd¡¢
Initial Catalog¡¢data sourceµÈλÖÿÉÒÔ×ÔÓÉ·Å
£¨1£©¡¢windowsÉí·ÝÑéÖ¤Á¬½ÓSQL2005×Ö·û´®£¬Ê¹ÓÃIntegrated Security=SSPI·½·¨
'ÒÔÏÂΪ½¨Á¢connection¶ÔÏóÁ¬½ÓÊý¾Ý¿â
Dim conn
Set conn=Server.CreateObject("ADODB.Connection")
sql="Provider=SQLoledb;data source=WWW-2443D34E558\SQL2005;UID=;PWD=;Initial Catalog=forum;Integrated Security=SSPI"
conn.Open sql
'ÒÔÏÂΪÅжÏÊÇ·ñÁ¬½Ó
If conn.state=2 Then
Response.Write("ÕýÔÚÁ¬½Ó")
ElseIf conn.state=1 Then
Response.Write("Á¬½ÓÒѾ´ò¿ª")
Else
Response.Write("¶Ô²»Æð£¬ÎÞ·¨´ò¿ªÁ¬½Ó")
End If
£¨2£©¡¢SQL SERVERÓû§ÃûÉí·ÝÑéÖ¤Á¬½Ó·½·¨,´ËÀýÖÐSQLÓû§ÃûΪsa ,ÃÜÂë********
'ÒÔÏÂΪ½¨Á¢connection¶ÔÏóÁ¬½ÓÊý¾Ý¿â
Dim conn
Set conn=Server.CreateObject("ADODB.Connection")
sql="Provider=SQLoledb;data source=WWW-2443D34E558\SQL2005;UID=sa;PWD=********;Initial Catalog=forum"
conn.Open sql
'ÒÔÏÂΪÅжÏÊÇ·ñÁ¬½Ó
If conn.state=2 Then
Response.Write("ÕýÔÚÁ¬½Ó")
ElseIf conn.state=1 Then
Response.Write("Á¬½ÓÒѾ´ò¿ª")
Else
Response.Write("¶Ô²»Æð£¬ÎÞ·¨´ò¿ªÁ¬½Ó")
&n
Ïà¹ØÎĵµ£º
1¡¢ÅäÖÃjava»·¾³£¬MyEclipse7.0¡£ÅäÖÃjboss5.0£¬Õ¹¿ªÑ¡ÔñjdkΪÒÑ°²×°µÄjdk·¾¶¡£
2¡¢°²×°2005ºÍsql2000£¬×°2000ʱҪװsp4.Çý¶¯Ñ¡Ôñjdbc2.0¡£ÔÙ×°2000ʱʵÀýÃû×Ô¼ºÊäÈëÒ»¸ö¡£ÕâÀïµÄÎÊÌâ¾ÍÊǵǼÃûºÍÃÜÂëµÄÉèÖã¬ÓÒ»÷“SQL Server×é”ϵÄʵÀýÃû£¨Windows NT)"µÄ“ÊôÐÔ”£¬ÔÚµ¯³öµÄ¶Ô»°¿ò ......
×¢Ò⣺ϵͳÐèÒªFSOȨÏÞ¡¢XMLHTTPȨÏÞ
ϵͳ°üÀ¨Á½¸öÎļþ£¬Æäʵ¿ÉÒԺϲ¢ÎªÒ»¸ö¡£Ö®ËùÒÔ·ÖΪÁ½¸öÊÇÒòΪ²¿·Öɱ¶¾Èí¼þ»áÒòΪÀï±ßº¬ÓÐFSO¡¢XMLHTTP²Ù×÷¶ø±»ÈÏΪÊǽű¾Ä¾Âí¡£
µ÷ÓÃʱ£¬ÐèÒªÔÚASPÒ³ÃæµÄ×îÉϱ߰üº¬Ö÷Îļþ£¬È»ºóÔÚϱßдÏÂÒÔÏ´úÂë
Set MyCatch=new CatchFile
MyCatch.Overdue=60*5 &n ......
SQL SERVER 2005ÒýÈëÁËÔÚµ¥Ò»Á¬½ÓÉ϶Զà»î¶¯½á¹û¼¯£¨Ò²³ÆΪMARS£©»ò¶à¸öÇëÇóµÄÖ§³Ö¡£Í¨¹ýÔÚÓëSQL SERVER 2005µÄÁ¬½ÓÉÏÆôÓÃÕâÒ»ÌØÐÔ£¬µ±´æÔÚÓëSqlconnectionÏà¹ØÁªµÄ¿ª·ÅʽSqlDataReaderʱ£¬Á¬½Ó½«²»»áÖжϡ£¼´Ê¹ÉÐδ¹Ø±Õµ±Ç°´ò¿ªµÄSqlDataReader£¬Ò²ÈÔÈ»Äܹ»ÔÚSqlconnectionÉÏÖ´ÐÐÆäËû²éѯ±ÈÈ磺SELECT£¬UPDATE£¬CREATETABL ......
ÓÐÁ½ÖÖ·½·¨¡£
·½·¨Ò»£ºÔÚmysql>Ìáʾ·ûÖÐʹÓÃtee
mysql> tee output.txt
Logging to file 'output.txt'
mysql> notee
Outfile disabled.
»òÕß
mysql> \T output.txt
Logging to file 'output.txt'
mysql> \t
Outfile disabled.
Õâ¸öÀàËÆÓÚsqlplusµÄspool¹¦ÄÜ£¬¿ÉÒÔ½«ÃüÁîÐÐÖеĽá¹û±£´æµ½Í ......