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Êý¾Ý¿â¸´ÖƵķ¢²¼¡¢¶©ÔĵÄÎÊÌâ´¦Àí[ת]
²Ù×÷ʹÓõÄһЩ¼¼ÇÉ(ÊÂÎñ¸´ÖÆÀàÐÍ):
1.ÈçºÎÐÞ¸ÄÒ»¸öÒѾ·¢²¼µÄ±íµÄÊôÐÔ?
½«·¢²¼ËùÓж©ÔÄɾ³ý,(·¢²¼²»ÓÃɾ³ý),¾Í¿ÉÒÔÔÚ·¢²¼ÊôÐÔµÄÏîÄ¿ÖÐÈ¡Ïû±í,È»ºó¾Í
¿ÉÒÔÐÞ¸ ......
--
> ²âÊÔÊý¾Ý£º[tb]
if
object_id
(
'
[tb]
'
)
is
not
null
drop
table
[
tb
]
go
create
table
[
tb
]
(
[
id
]
int
,
[
lx
]
int
)
insert
[
tb
]
select
29
,
2
union
all
select
30
,
3
union
all
sel ......
ÔÚInterDevÖÐʵÏÖÍøÉϹºÎïÍƳµ(1)
¡¡±¾ÎĽ«½éÉÜÔÚInterDevÖÐʵÏÖÍøÉÏÉ̵깺Îï³µ¹¦Äܵķ½·¨£¬¾ßÌå²½ÖèÈçÏ£º
¡¡¡¡Ò»¡¢ Êý¾Ý¿â½á¹¹£º
¡¡¡¡²úÆ·Êý¾Ý±í(Products): ´æ·Å²úÆ·ÐÅÏ¢
²úÆ·Ãû ProductName
²úÆ·±àºÅ ProductID
µ¥¼Û Price
·ÖÀà±àºÅ CategoryID
¡¡¡¡ Cart£º¹ºÎï³µÊý¾Ý±í£¬ÁÙʱ´æ·Å¿Í»§µÄ¶ ......
ÓÃASPÉè¼ÆÍøÕ¾ÔÚÏßÈËÊýͳ¼Æ³ÌÐò
¡¡¡¡ÔÚä¯ÀÀÍøÒ³µÄʱºî£¬³£³£¿ÉÒÔ¿´¼ûһЩ“µ±Ç°ÍøÕ¾ÉϵÄÈËÊýÊǣأأØÈË”µÄÔÚÏßÈËÊýͬ¼Æ¡£ÈçºÎÓÃASPÀ´×öÒ»¸öÄØ£¿Ê×ÏÈ£¬·ÖÎöÒ»ÏÂËüµÄ×ö·¨£¬Ò»°ãÀ´Ëµ£¬ÕâЩÏßÉÏÈËÊýͳ¼Æ¶¼ÊÇÖ¸Ò»¸öʱ¶ÎÄڵķÿÍÈËÊýͳ¼Æ¡£±ÈÈ磨5·ÖÖÓÄÚ£¬10·ÖÖÓÄÚ£©¶øÕâ¸öʱ¼äµÄ³¤¶Ì£¬ÊÇÓÉÉè¼ÆÕßÉ趨 ......
ÓÃASPʵÏÖÖ§³Ö¸½¼þµÄEMailϵͳ(3)
¡¡¡¡³¢ÊÔ·¢ËÍÓʼþ£¬µ«ÊÇʧ°ÜÁË£¬ÇëÐ޸ĴíÎóºóÖØÊÔ£¡
£¼script language="javascript"£¾
alert("ÄúÊäÈëµÄÊÕ¼þ×é¸ñʽ´íÎó£¡\rÕýÈ·µÄ¸ñʽÊÇ:'gr:001'");
history.back();
£¼/script£¾
£¼p£¾
£¼%
response.end
else
thegroup=(mid(trim(strfieldvalue),4))
end if
......