SQLConfigDataSource
´´½¨ODBCÊý¾ÝÔ´¿ÉÒÔµ÷ÓÃWindowsϵͳ×ÓÄ¿
¼ÏµĶ¯Ì¬Á´½Ó¿âOdbcint.dllÖеĺ¯ÊýSQLConfigDataSource()
¸Ãº¯Êý¿ÉÒÔ¶¯Ì¬µØÔö¼Ó¡¢Ð޸ĺÍɾ³ý
Êý¾ÝÔ´¡£
SQLConfigDataSource()º¯Êý
SQLConfigDataSource()µÄÔÐÍÈçÏÂ:
BOOL SQLConfigDataSource(HWND hwndParent, UINT
fRequest,LPCSTR IpszDriver, LPCSTR IpszAttributes);
ÆäÖÐËĸö²ÎÊýµÄÓ÷¨ÈçÏÂ:
¡ñ²ÎÊýhwndPwentÊǸ¸¼¶´°¿Ú¾ä±ú¡£Èç¹û¾ä±ú
ΪNULL£¬½«²»»áÏÔʾһЩÓйصĶԻ°¿ò¡£
Èç¹û²ÎÊý IpszAttributesÌṩµÄÐÅÏ¢²»¹»ÍêÉÆ£¬
ÔÚ´´½¨¹ý³ÌÖоͻá³öÏÖ¶Ô»°¿òÒªÇóÓû§ÌṩÏàÓ¦ÐÅ
Ï¢¡£
¡ñ²ÎÊýfRequest¿ÉÒÔÉèÖÃΪÏÂÃæµÄÊýÖµÖ®Ò»:
ODBC£ßADD£ßDSN: Ôö¼Ó£ß¸öÐÂÊý¾ÝÔ´
ODBC£ßCONHG£ßDSN: ÅäÖã¨ÐÞ¸Ä)Ò»¸öÒѾ´æÔÚµÄÊý¾ÝÔ´
ODBC£ßREMOVE£ßDSN: ɾ³ýÒ»¸öÒѾ´æÔÚµÄÊý¾ÝÔ´
ODBC£ßADD£ßSYS£ßDSN:. Ôö¼ÓÒ»¸öеÄϵͳÊý¾ÝÔ´
ODBC_CONFIG—SYS—DSN£º ¸ü¸ÄÒ»¸öÒѾ´æÔÚµÄϵͳÊý¾ÝÔ´
ODBC£ßREMOVE£ßSYS£ßDSN:. ɾ³ýÒ»¸öÒѾ´æÔÚµÄϵͳÊý¾ÝÔ´
¡ñ²ÎÊýlpszDriverÊÇÊý¾Ý¿âÒýÇæÃû³Æ£¬¿ÉÒԲμû
ODBC¹ÜÀíÆ÷ÖжÔODBCÇý¶¯³Ì ......
ÕâÒ»´ÎÀ´¼òµ¥½éÉÜÒ»ÏÂÎÒÔÚѧϰÖÐÓöµ½µÄÒ»¸öÎÊÌ⣬ÎÒÏÈÃèÊöһϣ¬È»ºó¿´²Ù×÷(ÉùÃ÷Ò»µã£ºÕâÒ»´ÎÎÒûÓаÑÕâ¸öÎÊÌâ½â¾öµô£¬Ï£ÍûÓÐÈË°ïÎÒ½â´ð)
-------------------------------------------------------------------------
»·¾³£ºwin2003 tomcat6 jsp»·¾³
ÎÒʹÓÃaccess2003×öÊý¾Ý¿â£¬Êý¾ÝÔ´ÒѾÅäÖúã¬Á¬½ÓÊý¾Ý¿âÒ²³É¹¦¡£
ÎÒµÄÄ¿µÄºÜ¼òµ¥£º×öÒ»¸öÁôÑÔϵͳ
µÇ½(login.jsp)——¡·ÑéÖ¤Êý¾Ý¿âÖÐÊÇ·ñÓÐÕâ¸öÓû§(login_conf.jsp)-->Èç¹ûÓÐÔòµÇ½³É¹¦--¡·¿ÉÒԲ鿴ÁôÑÔµÄÄÚÈÝ
ÏÂÃæ½Øͼ£º
Êý¾Ý¿â
±í
ÏÖÔÚÎÒĿ¼ÏµÄÎļþÇé¿ö£º
×¢ÒâÕâÀïûÓÐ.ldbÎļþ
ÏÂÃæÎÒÔËÐгÌÐò£ºÎªÁË·½±ãÎÒÖ±½ÓÓÃÕýÈ·µÄÓû§µÇ½
ΪÁ˹۲ìÔËÐÐÇé¿ö£¬ÎÒÔÚºǫ́´òÓ¡ÁËЩÎÄ×ÖÈçÏ£¬Í¬Ê±¹Û²ìºǫ́ÏÖÔÚËäÈ»²Ù×÷ÁËÊý¾Ýµ«ÊÇûÓвúÉúÄǸö.ldbÎļþ
ÏÂÃæ½øÈë²é¿´ÁôÑÔ³ÌÐò£º
ÎÒÔÚºóÃ渽ÉÏÎÒµÄÁ½¸ö´úÂ룬ÏÖÔÚ³öÏÖÁËldbÎļþ£¬·þÎñÆ÷ÖдòÓ¡Ò²ÖÕÖ¹ÁË¡£ÓÃEditPlus´ò¿ªÕâ¸öldbÎļþÊÇÎҵĻúÆ÷Ãû»¹ÓÐAdmin£¬¿´ÆðÀ´ÊÇÕâ¸öÓû§²¢Ëø¶¨¡£¡£
ÉÏÍø²éÕÒÁ˺ö෽·¨£¬²¢Ã»ÓÐʵÖÊÐÔ½â¾öµÄ¡£¿ÉÄÜÊÇÎÒÊý¾Ý¿â¹Ø±Õ´íÎ󣬵«ÎÒʵÔÚûÓп´³öÄÄÀï´íÁË¡£¡£
--------------------------------------------
ÉÏ´úÂ룺
......
ת×Ô£ºhttp://dev.yesky.com/243/2230743.shtml
ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ£¬¼´Ê¹Äã¶ÔOLE DB£¬COM²»Á˽âÒ²ÄÜÇáËɶԸ¶ADO,ÒòΪËü·Ç³£¼òµ¥Ò×Óã¬ÉõÖÁ±ÈÄãÒÔÍùËù½Ó´¥µÄODBC API¡¢DAO¡¢RDO¶¼ÒªÈÝÒ×ʹÓ㬲¢²»Ê§Áé»îÐÔ¡£±¾ÎÄÏêϸµØ½éÉÜÔÚVisual C++¿ª·¢»·¾³ÏÂÈçºÎʹÓÃADOÀ´½øÐÐÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢£¬²¢¸ø³öʾÀý´úÂ롣ΪÁËʹ¶ÁÕßÅóÓѶ¼ÄܲâÊÔ±¾ÀýÌṩµÄ´úÂ룬ÎÒÃDzÉÓÃAccessÊý¾Ý¿â£¬Äú¿ÉÒÔÖ±½ÓÔÚÎÒÃÇÌṩµÄʾÀý´úÂëÖÐÕÒµ½Õâ¸ötest.mdb¡£³ÌÐò±àÒëÔËÐкóµÄЧ¹ûÈçͼһËùʾ£º
ͼһ¡¢ADO²Ù×÷ACESSÊý¾Ý¿âµÄ½çÃæЧ¹ûͼ
¡¡¡¡Ò»¡¢ÊµÏÖ·½·¨
¡¡¡¡ÍòÊ¿ªÍ·ÄÑ£¬ÈκÎÒ»ÖÖм¼Êõ¶ÔÓÚ³õѧÕßÀ´Ëµ×îÖØÒªµÄ»¹ÊÇ"ÈëÃÅ"£¬ÕÆÎÕÆäÒªµã¡£ÈÃÎÒÃÇÀ´¿´¿´ADOÊý¾Ý¿â¿ª·¢µÄ»ù±¾Á÷³Ì°É£¡ËüµÄ»ù±¾²½ÖèÈçÏ£º
¡¡¡¡£¨1£©³õʼ»¯COM¿â£¬ÒýÈëADO¿â¶¨ÒåÎļþ
¡¡¡¡£¨2£©ÓÃConnection¶ÔÏóÁ¬½ÓÊý¾Ý¿â
¡¡¡¡£¨3£©ÀûÓý¨Á¢ºÃµÄÁ¬½Ó£¬Í¨¹ýConnection¡¢Command¶ÔÏóÖ´ÐÐSQLÃüÁ»òÀûÓÃRecordset¶ÔÏóÈ¡µÃ½á¹û¼Ç¼¼¯½øÐвéѯ¡¢´¦Àí¡£
¡¡¡¡£¨4£©Ê¹ÓÃÍê±Ïºó¹Ø±ÕÁ¬½ÓÊͷŶÔÏó¡£
¡¡¡¡ÏÂÃæÎÒÃǽ«Ïêϸ½éÉÜÉÏÊö²½Öè²¢¸ø³öÏà¹Ø´úÂë¡£
¡¡¡¡1¡¢COM¿âµÄ³õÊ ......
ת×Ô£ºhttp://dev.yesky.com/243/2230743.shtml
ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ£¬¼´Ê¹Äã¶ÔOLE DB£¬COM²»Á˽âÒ²ÄÜÇáËɶԸ¶ADO,ÒòΪËü·Ç³£¼òµ¥Ò×Óã¬ÉõÖÁ±ÈÄãÒÔÍùËù½Ó´¥µÄODBC API¡¢DAO¡¢RDO¶¼ÒªÈÝÒ×ʹÓ㬲¢²»Ê§Áé»îÐÔ¡£±¾ÎÄÏêϸµØ½éÉÜÔÚVisual C++¿ª·¢»·¾³ÏÂÈçºÎʹÓÃADOÀ´½øÐÐÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢£¬²¢¸ø³öʾÀý´úÂ롣ΪÁËʹ¶ÁÕßÅóÓѶ¼ÄܲâÊÔ±¾ÀýÌṩµÄ´úÂ룬ÎÒÃDzÉÓÃAccessÊý¾Ý¿â£¬Äú¿ÉÒÔÖ±½ÓÔÚÎÒÃÇÌṩµÄʾÀý´úÂëÖÐÕÒµ½Õâ¸ötest.mdb¡£³ÌÐò±àÒëÔËÐкóµÄЧ¹ûÈçͼһËùʾ£º
ͼһ¡¢ADO²Ù×÷ACESSÊý¾Ý¿âµÄ½çÃæЧ¹ûͼ
¡¡¡¡Ò»¡¢ÊµÏÖ·½·¨
¡¡¡¡ÍòÊ¿ªÍ·ÄÑ£¬ÈκÎÒ»ÖÖм¼Êõ¶ÔÓÚ³õѧÕßÀ´Ëµ×îÖØÒªµÄ»¹ÊÇ"ÈëÃÅ"£¬ÕÆÎÕÆäÒªµã¡£ÈÃÎÒÃÇÀ´¿´¿´ADOÊý¾Ý¿â¿ª·¢µÄ»ù±¾Á÷³Ì°É£¡ËüµÄ»ù±¾²½ÖèÈçÏ£º
¡¡¡¡£¨1£©³õʼ»¯COM¿â£¬ÒýÈëADO¿â¶¨ÒåÎļþ
¡¡¡¡£¨2£©ÓÃConnection¶ÔÏóÁ¬½ÓÊý¾Ý¿â
¡¡¡¡£¨3£©ÀûÓý¨Á¢ºÃµÄÁ¬½Ó£¬Í¨¹ýConnection¡¢Command¶ÔÏóÖ´ÐÐSQLÃüÁ»òÀûÓÃRecordset¶ÔÏóÈ¡µÃ½á¹û¼Ç¼¼¯½øÐвéѯ¡¢´¦Àí¡£
¡¡¡¡£¨4£©Ê¹ÓÃÍê±Ïºó¹Ø±ÕÁ¬½ÓÊͷŶÔÏó¡£
¡¡¡¡ÏÂÃæÎÒÃǽ«Ïêϸ½éÉÜÉÏÊö²½Öè²¢¸ø³öÏà¹Ø´úÂë¡£
¡¡¡¡1¡¢COM¿âµÄ³õÊ ......
ACCESSÖÐÖظ´ÐеĴ¦Àí
ACCESSÖУ¬Ê¹ÓÃdistinctºÍgroup byºó£¬Èç¹ûÔÚjavaÖÐʹÓÃrs.next()µÄ»°£¬¾Í»áÌáʾ“ÎÞЧµÄÓαꔴíÎó¡£
µ«ÊÇ£¬²¢·Ç²»Ö§³ÖÉÏÃæÁ½¸öÓï·¨¡£
ËùÒÔ£¬¿ÉÒÔͨ¹ýÒÔÏÂÓï·¨½øÐжþ´Î²éѯ£¬½«Öظ´Êý¾ÝÈ¥µô¡£
select stockName from (select stockName from stock group by stockName) order by stockName
select stockName from (select distinct stockName from stock) order by stockName
£¨µ±È»£¬Ê¾ÀýÖУ¬ÎÒÖ»²éѯÃû×Ö£¬ËùÒÔ£¬Ö»ÁгöÁËÒ»¸ö×ֶΣ© ......
ÔÒò£ºIISûÓÐ×¢²á
½â¾ö°ì·¨£º
·½·¨Ò»£º
ÔÚCMDÖнøÈëĿ¼C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727£¬ÔËÐÐaspnet_regiis
1¡¢aspnet_regiis -ga administrator£¨administratorΪµ±Ç°Óû§£©
2¡¢aspnet_regiis -i £¨×¢²áIIS£©
3¡¢iisreset /noforce £¨ÖØÆôIIS£©
²Ù×÷Ïêϸ£º
C:\Documents and Settings\Administrator>cd c:\\windows\\microsoft.net\\framework\\v2.0.50727
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -ga administrator
Start granting administrator access to the IIS metabase and other directories us
ed by ASP.NET.
Finished granting administrator access to the IIS metabase and other directories
used by ASP.NET.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -lv
2.0.50727.0 Valid C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\as
pnet_isapi.dll
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -i
Start installing ASP.NET (2.0.50727).
....... ......
ºǫ́Êý¾Ý¿â£º
[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]Ôò²»ÐèÒª£¬È磺d ......
ºǫ́Êý¾Ý¿â£º
[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]Ôò²»ÐèÒª£¬È磺d ......
ºǫ́Êý¾Ý¿â£º
[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]Ôò²»ÐèÒª£¬È磺d ......