AccessÎÊÌâ - .NET¼¼Êõ / ASP.NET
ÓÃAccessÊý¾Ý¿â×öµÄÍøÕ¾£¬connectionString д³É¡°Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\\SeaHorse\\Web\AccessDB\\seaHorse.mdbPersist Security Info=True" ¾ÖÓòÍø·¢²¼Ã»ÓÐÎÊÌ⣬ÇëÎÊ·¢²¼µ½Internetʱ»á²»»áÓÐÎÊÌ⣬¸ÃÔõôд°¡£¿
¿Ï¶¨»áÓÐÎÊÌ⣬³ý·ÇÔÚ·þÎñÆ÷ÉÏÊý¾Ý¿âµÄ·¾¶Ò²ÊÇ F:\\SeaHorse\\Web\AccessDB\\seaHorse.mdb
µ±È»»áÓÐÎÊÌâ ·¾¶ÒªÓÃÏà¶Ô·¾¶ »ñÈ¡·þÎñÆ÷¶Ë·¾¶²Å¿ÉÒÔ
Â¥Ö÷·¢²¼µ½Êý¾Ý¿âרÇø²ÅÊÇ
¸Ä
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("AccessDB\\seaHorse.mdb");
3Â¥ÄǸöÃÀŮͷÏñµÄÇ°±²£¬web.ConfigÔõôÒýÈëServer.MapPath£¿»¹ÓУ¬Á´½Ó´®¿ÉÒÔÄÇÑùдµÄÂð£¿ÎҸijÉÄãµÄÄÇÖÖ¸ñʽ£¬ËüÓï·¨ÓдíÎó¡
°ÑseaHorse.mdb·ÅÔÚApp_DataÖÐ
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|\\seaHorse.mdb");
Data Source=|DataDirectory|\Êý¾Ý¿â.mdb
ÔÚÏîÄ¿Àï¼ÓÒ»¸öApp_DataÎļþ¼Ð£¬°ÑÊý¾Ý¿â·Å½øÈ¥
web.configÖеÄд·¨ÈçÏ£º
<appSettings>
<add key="SQLConnString" value="provider=microsoft.jet.oledb.4.0;data source="/>
<add key="dbPath" value="~AccessDB/seaHorse.mdb"/>
</appSettings>
string connectionString = System.Configuration.ConfigurationManager.AppSettings["SQLConnString"].ToString() + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["dbPath"]) ;
Ïà¹ØÎÊ´ð£º
ÎÒÓÃasp.net¿ª·¢wapÕ¾µã£¬Íê³ÉºóÈ¥http://validator.w3.org/ÕâÀïÑéÖ¤ÎÒµÄWapÒ³ÃæÊÇ·ñ±ê×¼£¬ÆäËüÎÊÌⶼ¸ÄºÃÁË£¬
¾ÍÊ£ÕâÒ»¸ö´íÎóÁË£¬°´×ÖÃæÒâ˼Àí½âÊÇ˵nameÊôÐÔÒÑ´æÔÚ£¬ÀàËÆÕâÑùµÄ´íÎó»¹Óв»ÄÜÓÃborder ,align,sizeµ ......
asp.netÅúÁ¿ÉÏ´«Í¼Æ¬×îºÃÓÐÔ´Â룬ÔÚÏߵȣ¡£¡£¡£¡£¡£¡£¡
Ô´ÂëºÜ³¤µÄ¡£
²Î¿¼
C# code:
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
......
ʹÓÃACCESS×î´óµÄÒþ»¼¾ÍÊDz»°²È«¡£½ñÌì¶ÔACCESSÊý¾Ý¿âÉèÖÃÁËÒ»¸öÃÜÂ룬±ØÐëʹÓÃÃÜÂë²ÅÄÜ´ò¿ª£¬µ«ÊÇÔÚ³ÌÐòÖÐÈ´ÎÞ·¨Á¬½ÓÊý¾Ý¿âÁË¡£´ó¼ÒÖªµÀʹÓÃÓû§ÃûºÍÃÜÂ룬ÈçºÎÁ¬½ÓACCESSÊý¾Ý¿â£¿Ã²ËÆACCESSµÄÓû§Ãû»¹²»ÖªµÀ£¿Ö»Öª ......
O O O O O O
|.......| |........| |.......|
| | |
O O ......