AccessÓëSql ServerÖ®ASP´úÂë±È½Ï
ºǫ́Êý¾Ý¿â£º
[Microsoft Access]
Óë
[Microsoft Sql Server]
¸ü»»Ö®ºó£¬ASP´úÂëӦעÒâÒªÐ޸ĵÄһЩµØ·½£º
[Ò»]Á¬½ÓÎÊÌ⣨¾ÙÀý)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATABASE=mydata;uid=sa;pwd="
[¶þ]ÏàËƺ¯Êý£¨¾ÙÀý£©
[1]DATEDIFF(datepart, startdate, enddate)
ÆäÖГdatepart”²ÎÊý¿ÉÑ¡ÏîÈçÏ£º
ÉèÖà ÃèÊö
————————————
[Microsoft Access]
Äê yyyy
¼¾¶È q
ÔÂ m
Ò»ÄêµÄÈÕÊý y
ÈÕ d
Ò»ÖܵÄÈÕÊý w
ÖÜ ww
Сʱ h
·ÖÖÓ n
Ãë s
[Microsoft Sql Server]
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
hour hh
minute mi, n
second ss, s
millisecond ms
-------------------------
»ù±¾Éϲ¶à£¬µ«×¢ÒâµÄÊÇÔÚдµÄʱºò£¬
[Microsoft Access]Òª¼ÓÒýºÅ£¬È磺datediff('d',enddate,'2004/08/01')
[Microsoft Sql Server]Ôò²»ÐèÒª£¬È磺datediff(d,enddate,'2004/08/01')
[2][Microsoft Access]ÖпÉÓÃÈçcstrµÈתÊý¾ÝÀàÐͺ¯Êý£¬¶ø
[Microsoft Sql Server]ÖÐÔòÓÃconvert»òcastº¯Êý£¬È磺
convert(varchar,[amount])µÈ¡£
[3][Microsoft Sql Server]
È¡µ±Ç°Ê±¼äÓÃgetdateµÈµÈ...
[Èý]Óï¾ä
[Microsoft Sql Server]
¿ÉÒÔÓÃ
CASE
WHEN THEN
WHEN THEN
...
ELSE
END
Óï¾ä£¬¶ø
[Microsoft Access]
²»Ö§³Ö¡£
[Microsoft Access]Ò²²»Ö§³ÖbetweenÓï¾ä
[Microsoft Sql Server]Ôò¿ÉÒÔÕâÑùд£º
[date] between @date1 and @date2
[ËÄ]²éѯ±í
[Microsoft Sql Server]
¿ÉÈý¸ö¼°ÒÔÉϱíjoin²éѯ£¬¶ø
[Microsoft Access]
ºÃÏñÖ»ÄÜÁ½¸ö±íÁª½Ó²éѯ£¨´ýȨÍþÈ·ÈÏ£©,
¶øÇÒ[Microsoft Sql Server]¿ÉÓÓ*=”ºÍ“=*”Á¬½Ó·û¡£[Îå]³ýÁãÎÊÌâ
[Microsoft Access]
ÔÚÅöµ½³ýÊýΪÁãʱ£¬×Ô¶¯¶ªµôÏà¹Ø¼Ç¼£¬¶ø
[Microsoft Sql Server]
Ôò»á±¨´í£¬ÇÒ²éѯÖÐÖ¹¡£É¾³ý´úÂ룺
[Microsoft Access]
¿ÉÒÔÕâÑùд£ºdelete * from [table]
[Microsoft SQL Server]
Ö»ÄÜÕâÑùд£ºdelete from [table]
¶à*»á±¨´í
_____________________________________
µ±Ç°ÈÕÆÚ£º
Ïà¹ØÎĵµ£º
Ðл»ÁУº
--> Éú³É²âÊÔÊý¾Ý±í: [tb]
IF OBJECT_ID('[tb]') IS NOT NULL
DROP TABLE [tb]
GO
CREATE TABLE [tb] ([a] [int],[b] [int],[c] [int])
INSERT INTO [tb]
SELECT '3','9','5' UNION ALL
SELECT '5','2','7' UNION ALL
SELECT '6','3','8'
--SELECT * from [tb]
-->SQL²éѯÈçÏ ......
ÓÃASPÉè¼ÆÍøÕ¾ÔÚÏßÈËÊýͳ¼Æ³ÌÐò
¡¡¡¡ÔÚä¯ÀÀÍøÒ³µÄʱºî£¬³£³£¿ÉÒÔ¿´¼ûһЩ“µ±Ç°ÍøÕ¾ÉϵÄÈËÊýÊǣأأØÈË”µÄÔÚÏßÈËÊýͬ¼Æ¡£ÈçºÎÓÃASPÀ´×öÒ»¸öÄØ£¿Ê×ÏÈ£¬·ÖÎöÒ»ÏÂËüµÄ×ö·¨£¬Ò»°ãÀ´Ëµ£¬ÕâЩÏßÉÏÈËÊýͳ¼Æ¶¼ÊÇÖ¸Ò»¸öʱ¶ÎÄڵķÿÍÈËÊýͳ¼Æ¡£±ÈÈ磨5·ÖÖÓÄÚ£¬10·ÖÖÓÄÚ£©¶øÕâ¸öʱ¼äµÄ³¤¶Ì£¬ÊÇÓÉÉè¼ÆÕßÉ趨 ......
ÓÃASPʵÏÖÖ§³Ö¸½¼þµÄEMailϵͳ(1)
¡¡¡¡´ó¼Ò¾³£Ì½ÌÖʹÓÃasp£¬¶ø²»Ê¹ÓÃÆäËû×齨ÄÜ·ñʵÏÖÎļþµÄÉÏ´«£¬´Ó¶ø¿ª·¢³öÖ§³ÖÓʼþ¸½¼þµÄÓʼþϵͳ£¬´ð°¸ÊÇ¿ÉÒԵġ£
¡¡¡¡ÒÔÏÂÊÇ·¢ËÍÓʼþµÄÒ³Ã棬ÓʼþµÄÕʺÅÊÇÔ±¹¤ºÅ£¬¼ÙÉèÊÇ5λµÄÊý×Ö£¬sendmail.aspµ±È»ÊÇÔںϷ¨µÇ½ºó²ÅÄܹ»¿´µ½µÄ
£¼html£¾
£¼head£¾
£¼meta http-eq ......
ÓÃASPʵÏÖÖ§³Ö¸½¼þµÄEMailϵͳ(1)
¡¡¡¡´ó¼Ò¾³£Ì½ÌÖʹÓÃasp£¬¶ø²»Ê¹ÓÃÆäËû×齨ÄÜ·ñʵÏÖÎļþµÄÉÏ´«£¬´Ó¶ø¿ª·¢³öÖ§³ÖÓʼþ¸½¼þµÄÓʼþϵͳ£¬´ð°¸ÊÇ¿ÉÒԵġ£
¡¡¡¡ÒÔÏÂÊÇ·¢ËÍÓʼþµÄÒ³Ã棬ÓʼþµÄÕʺÅÊÇÔ±¹¤ºÅ£¬¼ÙÉèÊÇ5λµÄÊý×Ö£¬sendmail.aspµ±È»ÊÇÔںϷ¨µÇ½ºó²ÅÄܹ»¿´µ½µÄ
£¼html£¾
£¼head£¾
£¼meta http-eq ......
<bgsound src="wen.mid" loop="0">
<% dim weh
If Time >=#1:00:00 AM# And Time < #6:00:00 PM# Then
weh = "<bgsound src="1.mid" loop="0">"
Else If Time >#6:00:00 AM# And Time < #9:00:00 PM#
weh = "<bgso ......