»ñÈ¡AccessÓû§¶¨ÒåµÄ±íÃûºÍ¸÷±íµÄ×Ö¶ÎÃû
public static DataTable GetSchemaTable(string connectionString) //»ñÈ¡AccessËùÓеıíÃû£»
{
using (OleDbConnection connection = new
OleDbConnection(connectionString))
{
connection.Open();
DataTable schemaTable = connection.GetOleDbSchemaTable(
OleDbSchemaGuid.Tables,
new object[] { null, null, null, "TABLE" });
return schemaTable;
}
}
private string[] GetTabelName(string conn) //»ñÈ¡AccessÎļþÖÐËùÓбíÃû£¬·ÅÔÚÊý×éÀïÃæ
{
DataTable dt = GetSchemaTable(conn);
int n = dt.Rows.Count;
string[] strTable = new string[n];
int m = dt.Columns.IndexOf("TABLE_NAME");
for (int i = 0; i < n; i++)
 
Ïà¹ØÎĵµ£º
ÓÃTSQL°ÑAccessµÄ±íµ¼Èëµ½Ô¶³ÌSql Server£º
°Ñaccess µÄ.mdbÀït_itemList ±íµÄÊý¾Ý²åÈëµ½Ô¶³ÌSqlServerµÄt_itemL1111111±íÀï¡£
SELECT top 10 * INTO t_itemL1111111 IN [ODBC]
[ODBC;Driver=SQL Server; UID=jyb;PWD=jyb;Server=10.1.18.49;DataBase=ËùÓкϲ¢;]
&nb ......
±¾À´¿¼ÂÇÓÃXMLÎļþÀ´´æÊý¾ÝÊÇÒòΪÆä¿çƽ̨ÐÔ£¬¶øÇÒ²»Óð²×°Ìض¨µÄÈí¼þ¡£µ«¾¹ýÑо¿ÁËÒ»Õó×Ó·¢ÏÖ£¬XMLÓÃÓÚ´æ·ÅÉÙÊý¾ÝÊÇ¿ÉÒÔ£¬µ«´æ·Å´óÖÐÐÍÊý¾Ý¾ÍÏԵúܳÔÁ¦£¬»³ÒÉҲûÓÐÈË»áÕâô×ö¡£¶øÈç¹û²ÉÓÃSQL SERVER´æÊý¾Ý£¬ÓÖÏԵñȽÏÇü²Å£¬±Ï¾¹ÎÒ×öµÄÖ»ÊÇÑо¿¿Í»§¶ËµÄÒ»¸öС³ÌÐò£¬ÅäÖôú¼ÛҲ̫´óÁË¡£»ùÓÚÕâÁ½ÕßÖ®¼ä£¬»¹ÊǾö¶¨Ñ ......
Ò»¡¢ SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºó ......
ÔÚ±àд×Ô¼ºµÄdll³ÌÐòµÄʱºò£¬ÏÈ¿ªÊ¼ÔÚµ÷ÓÃdllµÄexeÉϳöÏÖ(AVIDLL.DLL): 0xC0000005: Access Violation£¬²»ÊǺÜÃ÷°×£¬ÎªÊ²Ã´»á³öÏÖÕâ¸öÎÊÌâ¡£
ÔÚÄÚ²¿½øÐе÷ÊÔµÄʱºò·¢ÏÖ£¬Êǵ÷ÓÃÁËnew²Ù×÷·ûµÄÔµ¹Ê¡£
ºÜ²»Àí½â£¬ÔÚdllÖе÷ÓÃnew²Ù×÷·û»á³öÏÖÕâôһ¸öÎÊÌ⣬ÍøÂçÉÏËÑË÷£¬ÔÚ΢ÈímsdnÂÛ̳£¨¾ßÌåµØÖ·£ºhttp://forums.msdn.mic ......
Ò»¡¢´´½¨Ò»ÕÅ¿Õ±í£º
Sql="Create TABLE [±íÃû]"
¶þ¡¢´´½¨Ò»ÕÅÓÐ×Ö¶ÎµÄ±í£º
Sql="Create TABLE [±íÃû]([×Ö¶ÎÃû1] MEMO NOT NULL, [×Ö¶ÎÃû2] MEMO, [×Ö¶ÎÃû3] COUNTER NOT NULL, [×Ö¶ÎÃû4] DATETIME, [×Ö¶ÎÃû5] TEXT(200), [×Ö¶ÎÃû6] TEXT(200))
×Ö¶ÎÀàÐÍ£º
2 : "SmallInt", // ÕûÐÍ
3 : "Int", ......