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]
¶à*»á±¨´í
_____________________________________
µ±Ç°ÈÕÆÚ£º
Ïà¹ØÎĵµ£º
Ê×ÏȽéÉÜÒ»ÏÂʲôÊÇ´æ´¢¹ý³Ì£º´æ´¢¹ý³Ì¾ÍÊǽ«³£ÓõĻòºÜ¸´ÔӵŤ×÷£¬Ô¤ÏÈÓÃSQLÓï¾äдºÃ²¢ÓÃÒ»¸öÖ¸¶¨µÄÃû³Æ´æ´¢ÆðÀ´£¬²¢ÇÒÕâÑùµÄÓï¾äÊÇ·ÅÔÚÊý¾Ý¿âÖеģ¬»¹¿ÉÒÔ¸ù¾ÝÌõ¼þÖ´Ðв»Í¬SQLÓï¾ä£¬ ÄÇôÒÔºóÒª½ÐÊý¾Ý¿âÌṩÓëÒѶ¨ÒåºÃµÄ´æ´¢¹ý³ÌµÄ¹¦ÄÜÏàͬµÄ·þÎñʱ£¬Ö»Ðèµ÷ÓÃexecute,¼´¿É×Ô¶¯Íê³ÉÃüÁî¡£
¡¡¡¡Çë´ó¼ÒÀ´Á˽âһϴ洢¹ý³Ìµ ......
´´½¨sqlÊý¾Ý¿â¸´ÖƵķ¢²¼¡¢¶©ÔĵÄÎÊÌâ´¦Àí[ת]
²Ù×÷ʹÓõÄһЩ¼¼ÇÉ(ÊÂÎñ¸´ÖÆÀàÐÍ):
1.ÈçºÎÐÞ¸ÄÒ»¸öÒѾ·¢²¼µÄ±íµÄÊôÐÔ?
½«·¢²¼ËùÓж©ÔÄɾ³ý,(·¢²¼²»ÓÃɾ³ý),¾Í¿ÉÒÔÔÚ·¢²¼ÊôÐÔµÄÏîÄ¿ÖÐÈ¡Ïû±í,È»ºó¾Í
¿ÉÒÔÐÞ¸ ......
ÓÃASPÉè¼ÆÍøÕ¾ÔÚÏßÈËÊýͳ¼Æ³ÌÐò
¡¡¡¡ÔÚä¯ÀÀÍøÒ³µÄʱºî£¬³£³£¿ÉÒÔ¿´¼ûһЩ“µ±Ç°ÍøÕ¾ÉϵÄÈËÊýÊǣأأØÈË”µÄÔÚÏßÈËÊýͬ¼Æ¡£ÈçºÎÓÃASPÀ´×öÒ»¸öÄØ£¿Ê×ÏÈ£¬·ÖÎöÒ»ÏÂËüµÄ×ö·¨£¬Ò»°ãÀ´Ëµ£¬ÕâЩÏßÉÏÈËÊýͳ¼Æ¶¼ÊÇÖ¸Ò»¸öʱ¶ÎÄڵķÿÍÈËÊýͳ¼Æ¡£±ÈÈ磨5·ÖÖÓÄÚ£¬10·ÖÖÓÄÚ£©¶øÕâ¸öʱ¼äµÄ³¤¶Ì£¬ÊÇÓÉÉè¼ÆÕßÉ趨 ......
ÀûÓÃASP´òÔìÍøÕ¾ÂÛ̳DIY(3)
¡¡¡¡2¡¢¹¹½¨ÎÄÕÂÏÔʾģ¿é
¡¡¡¡Ç°Ãæ˵¹ý£¬Ò»Æ¬¾ßÌåµÄÎÄÕÂÊÇ·ÖÊôÔÚ¿´°åºÍÖ÷Ìå֮ϵġ£Òò´ËÏÔʾÎÄÕÂÒ²Òª¾¹ý¿´°åÁбíºÍÖ÷ÌåÁбíÕâÁ½Ò³Ãæºó£¬²ÅÄܵõ½Ìض¨Ö÷ÌâÏÂÎÄÕµÄÁÐ±í¡£
¡¡¡¡£¨1£©°åÁбíµÄÏÔʾҳÃ棺
£¼ html£¾
£¼ head£¾
£¼ title£¾¿´°åÁÐ±í£¼ /title£¾
£¼ meta htt ......