Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓÃADO¹ÜÀíSQL SERVER £¡

      ÔÚÈí¼þ¿ª·¢ÖУ¬³£³£ÐèҪΪ³ÌÐò½¨Á¢Sql ServerÊý¾Ý¿âµÄÔËÐл·¾³¡£Íê³ÉÈçÔÚSQL ServerÊý¾Ý¿âÖн¨Á¢É豸£¬½¨Á¢Êý¾Ý¿â£¬½¨Á¢±í¸ñ£¬·ÖÅäȨÏ޵ȹ¦ÄÜ£¬ÈçºÎ·½±ãµÄ½¨Á¢Ó¦ÓóÌÐòËùÐèSql Server»·¾³µÄÊý¾Ý¿â»·¾³£¬¶ø²»ÓÃÆô¶¯SQL Enterprise ManagerÄØ£¿
ÏÂÃæÀ´¿´£º 
¡¡¡¡Æô¶¯VB6.0£¬Ð½¨Ò»¸ö¹¤³Ì,Ôڲ˵¥-¹¤³Ì-ÒýÓÃÀïÑ¡"Microsoft ActiveX Data Objects 2.0 Library",´úÂëÀïÐèÒªÓÐ
dim conn As New ADODB.Connection ‘¶¨ÒåADOÊý¾Ý¿â¶ÔÏó
conn.ConnectionString = "driver={SQL Server};" & "server=" & ServerName & ";uid=" & UserName & ";
pwd=" & Password & ";database=" & DatabaseName & "" ’Á¬½ÓÊý¾Ý´®
conn.open ‘Á¬½ÓÊý¾Ý¿â
¡¡¡¡ ×¢£ºServerNameΪ·þÎñÆ÷Ãû£»UserNameΪÓû§Ãû£»PasswordΪÓû§¿ÚÁ DatabaseNameÒªµÇ¼µÄÊý¾Ý¿âÃû£¬¿ÉÒÔΪ¿Õ¡£
¡¡¡¡ ºËÐÄ´úÂëÈçÏ£º
Ò»¡¢½¨Á¢Êý¾Ý¿â
¡¡¡¡ Ô­Àí£º½¨Á¢Êý¾Ý¿âÏÈÒª³õʼ»¯Ò»¸öÊý¾Ý¿âÉ豸£¬È»ºóÔÚ´ËÉ豸ÉϽ¨Á¢Êý¾Ý¿â¡£ËùÓеÄÉ豸ÃûÔÚϵͳ±í"sysdevices"ÀïÓмǼ£¬ËùÓеÄÊý¾Ý¿âÃûÔÚϵͳ±í"sysdatabases"ÀïÓмǼ¡£ÔÚ½¨Á¢Ö®Ç°£¬×îºÃÏȲéѯÕâÁ½¸öϵͳ±í£¬¿´Ãû³ÆÊÇ·ñÒѾ­´æÔÚ¡£ÔÚ½¨Á¢É豸֮ǰ£¬»¹ÐèÒªµÄÒ»¸öÎïÀíÃûºÍ¿ÕÏеÄÉ豸±êʶºÅ¡£
³õʼ»¯É豸Óï·¨£º
DISK INIT NAME="device_name",PHYNAME="physical_name",VDEVNO=device_number,SIZE=numberofblock
¡¡¡¡ ˵Ã÷£ºÕâÀNAMEÊÇÊý¾Ý¿âÉ豸Ãû£¨Ò»¸öÓÐЧµÄ±êʶ·û£©£¬PHYNAME(Êý¾Ý¿âÉ豸µÄÎïÀíÃû)ÊÇԭʼµÄ´ÅÅÌ·ÖÇøUNIX»òÍâÉ裨vms£©Ãû£¬»òÕßÊDzÙ×÷ϵͳµÄÎļþÃû¡£VDEVNOʱÊý¾Ý¿âµÄÉ豸±êʶºÅ£¬ºÏ·¨ÖµÎª1-255£¬SIZEµÄµ¥Î»ÊÇ2KBµÄ¿é£¬ÀýÈç1MB£¨1024KB£©Ê±SIZEֵΪ512¡£
¡¡¡¡ ½¨Á¢Êý¾Ý¿âÓï·¨£ºCREATE DATABASE database_name [ON database_device]
¡¡¡¡ ˵Ã÷£ºdatabase_nameÊÇÒª½¨µÄÊý¾Ý¿âÃû£¬database_deviceÊÇÉ豸Ãû
¡¡¡¡ Ҫн¨Á¢Ò»¸öÊý¾Ý¿â£¬¾ÍÐèÒªÉ豸Ãû£¬Êý¾Ý¿âÃû£¬ÎïÀíÃûºÍÉ豸ºÅ¡£¾ßÌå²½ÖèÈçÏ£º
¡¡¡¡ ÎÒÃǼÙÉèÓû§ÒªÐ½¨Á¢É豸dbName£¬ÔÚÉ豸dbNameÉϽ¨Á¢Êý¾Ý¿âdbName¡£
¡¡¡¡ 1£©µÃµ½É豸Ãû bNameÊÇÓû§¸ø³öµÄÉ豸Ãû£»ÏȲéѯϵͳ±ísysdevices£¬¿´Óû§¸ø³öµÄÉ豸ÃûdbNameÊÇ·ñÒѾ­´æÔÚ£¬Èç¹û´ËÉ豸Ãû´æÔÚ£¬¾ÍÐèÒª¸ü»»Ò»¸öÉ豸Ãû£¬ÒòΪÉ豸ÃûÊÇΨһµÄ¡£
sql = "select * from sysdevices
where name=" & dbName & ""
Set rs =


Ïà¹ØÎĵµ£º

Sql Server2005 ת Access

ÔÚÍøÉÏÕÒÁ˺öà¹ØÓÚSqlServer2005תaccessµÄ·½·¨£¬´ó¶à¶¼ÊÇÓÃsqlÓï¾ä£¬¶øÎÒ²»ÏëÓÃÄÇÖÖ·½·¨£¬ÓÚÊÇÎÒ×Ô¼ºÃþË÷³öÀ´ÈçºÎ½«SqlServerÊý¾Ý¿âת»»³Éaccess£¬·½·¨¿ÉÄÜÓе㱿£¬²»¹ýÍê³ÉÁËת»»µÄ¹¦ÄÜ¡£ÏÂÃæÊǾßÌå²½Ö裺
1.´ò¿ªAccess£¬½¨Á¢Ò»¸öºó׺ÃûΪ.mdbµÄ¿ÕµÄÊý¾Ý¿âÎļþ£¨Ä¬ÈϺó׺¿ÉÄÜÊÇ.accdb,ÎÒÃÇ°ÑËü¸ÄΪ.mdb¾Í¿ÉÒÔÁË£©£¬È»ºó ......

Sql»ù±¾Óï¾äµÄѧϰ

--²éѯÿ¸öÈ˶©·¹µÄ´ÎÊý
select  username as ÐÕÃû, count(*) as ´ÎÊý from orderitems  group by UserName having count(*)=1
order by ÐÕÃû desc
select distinct username as δע²áÐÕÃû from orderitems
where username not in (select [Name] from Person)
select distinct username as ÒÑ×¢²áÐÕÃû fr ......

SQL Server 2000/2005 ·ÖÒ³SQL

SQL ServerÖм¸ÖÖ·ÖÒ³µÄsqlÓï¾ä
·½·¨1£º
ÊÊÓÃÓÚ SQL Server 2000/2005
SELECT TOP Ò³´óС *
from table1
WHERE id NOT IN
          (
          SELECT TOP Ò ......

ÓÃADO¹ÜÀíSQL SERVER

ÓÃADO¹ÜÀíSQL SERVER
http://blog.csdn.net/cncco/archive/2009/11/09/4789123.aspx
ÔÚÈí¼þ¿ª·¢ÖУ¬³£³£ÐèҪΪ³ÌÐò½¨Á¢Sql ServerÊý¾Ý¿âµÄÔËÐл·¾³¡£Íê³ÉÈçÔÚSQL ServerÊý¾Ý¿âÖн¨Á¢É豸£¬½¨Á¢Êý¾Ý¿â£¬½¨Á¢±í¸ñ£¬·ÖÅäȨÏ޵ȹ¦ÄÜ£¬ÈçºÎ·½±ãµÄ½¨Á¢Ó¦ÓóÌÐòËùÐèSql Server»·¾³µÄÊý¾Ý¿â»·¾³£¬¶ø²»ÓÃÆô¶¯SQL Enterprise Manage ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ