½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ
1.´ò¿ªSQL server enterprise mananger “ÆóÒµ¹ÜÀíÆ÷”
ÔÚÄãÒªµ¼³öµÄSQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍΪ“Microsoft Access¡£µã “ÎļþÃû(F)” ºóÃæµÄ°´Å¥Ñ¡ÔñÄ¿±ê.MDBÎļþ¡£
4.Ñ¡Ôñ“´ÓÊý¾Ý¿â¸´ÖƱíºÍÊÓͼ”¡£
5.ÎÒÃÇ×¢ÒâÕâÀïÑ¡±íµÄʱºòÓÒ±ßÓÐÒ»¸ö“ת»»”ÁС£SQLµ¼³öֻת»»Êý¾ÝÀàÐͲ¢²»¿¼ÂÇÆäËû½Å±¾ËùÒÔÎÒÃÇÓöµ½µÄ×Ô¶¯±àºÅÎÊÌâÒ²¾Í³öÔÚÕâÀï¡£ÓÐ×Ô¶¯±àºÅµÄÒ»¶¨ÒªµãÑ¡“ת»»”¡£
6.ÎÒÃǻؿ´µ½Ò»¸ö“ÁÐÓ³ÉäºÍת»»”¶Ô»°¿ò¡£ÓÐ×¢Òâµ½×ÔÔöµÄemployeeid int ×ÔÔöÕâÀï±ä³ÉÁËAccessÀïµÄlongÕâ¿Ï¶¨²»¶Ô£¬long²¢²»ÊÇ×Ô¶¯±àºÅ£¬Ö»ºÃÐ޸Ľ¨±í½Å±¾£¬Í¼Æ¬ÉÏÄǸöºìȦÀïµÄ°´Å¥“±à¼SQL”¡£
¿ªÒ»¸öС´°create talbe
ºìȦÖеĽű¾¾ÍÊÇemployeeid µÄ Access½¨±í½Å±¾£¬ÔÚ “NOT NULL” Ç°Ãæ¼ÓÉÏ “IDENTITY (1, 1)”¡£
7.Á¢¼´Ö´ÐС£
ÏÂͼ±íʾ½¨±í¸´ÖÆÒѳɹ¦
8.ÎÒÃÇ´ò¿ªMDBÎļþ¿´¿´ÊDz»ÊÇÈçÎÒÃÇËùÔ¸£¿
OKÍê³É£¬¹§Ï²Äã²Ù×÷³É¹¦
Ïà¹ØÎĵµ£º
Sql´úÂë
--²ÉÓÃSQLÓï¾äʵÏÖsql2005ºÍExcel Êý¾ÝÖ®¼äµÄÊý¾Ýµ¼Èëµ¼³ö£¬ÔÚÍøÉÏÕÒÀ´Ò»--Ï£¬ÊµÏÖ·½·¨ÊÇÕâÑùµÄ£º
--Excel---->SQL2005 µ¼È룺
select * into useinfo from O ......
set safety off
local oo,lcStr,lcMdbFile,i,x,lnFields,lcTableName,lnFieldtype,lcCurdir
lcCurdir = sys(5) + curdir()
lcNowdir = getdir()
cd (lcNowdir)
&nb ......
ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXCELÊý¾Ýת»»£ ......
using System.Data.OleDb; //ÕâÀïÒªÒýÓÃOleDb¿Õ¼ä
public partial class addInfo : System.Web.UI.Page
{
//Êý¾Ý¿âÁ¬½Ó×Ö·û´®
static string strCon = @"provider = Microsoft.Jet.OLEDB.4.0;Data source = |DataDirectory|gyMDB.mdb";
//ÒÔÉÏ·½·¨ÎªÁ¬½ÓACC ......
ÈçºÎÔÚ Access ÖвåÈëÒ»ÌõеļǼʱ,Ô¤ÏÈÖªµÀËûµÄ×Ô¶¯±àºÅIDÄØ?
Õâ¸öÎÊÌâÀ§ÈÅÁËÎҺܾÃ
ºóÀ´ÎÒÏëÁËÒ»¸öºÜ±¿°ì·¨
¾ÍÊÇÏȲåÈëÒ»Ìõ ËæÒâµÄÊý¾Ý µ±È»ÀïÃæÓÐÓÐÒ»¸öÄãʵÏÖÔ¤¶¨ºÃµÄ±êʶ
±ÈÈç
insert into cmd (classID,cmdType,cmd) values('temp','temp','temp')
È»ºóÕÒµ½Ëü ¶ÁÈ¡ËüµÄID
select * from cmd where classID ......