ʹÓÃVB½«Excelµ¼Èëµ½SqlÖÐ
ʹÓÃVB°ÑExcelµ¼Èëµ½SqlÊý¾Ý¿âÖУ¬ÆäʵÓм¸ÖÖ·½·¨¡£
ÏÂÃæÎÒ½éÉܵÄÕâÖÖ·½·¨£¬½ÏΪ¼òµ¥¡£
ÆäʵÕâÖÖ·½·¨µÄ»°£¬ÊÇÖ±½ÓʹÓÃT-SQL²Ù×÷µÄ£¬Òò´Ë£¬µ½ÁËVBÀïÃæ£¬Ö±½ÓeccuteÕâ¸ö´úÂë¾ÍOKÁ˵ġ£
-----------------------------------------------------ÏÂÃæÊÇÔÚT-sqlÖеÄÓï¾ä
if object_id('NewTable') is not null/*ÅжϱíNewTableÊÇ·ñ´æÔÚ£¬Èç¹û´æÔÚÔòɾ³ýËü*/
drop table NewTable
Select * Into NewTable from OpenDataSource('Microsoft.Jet.OLEDB.4.0'," _
& "'Data Source=" & ExcelÎļþÃû£¨¾ø¶Ô·¾¶£© & _
";User ID=Admin;Password=;Extended properties=Excel 5.0')...[¹¤×÷±íÃû]
-----------------------------------------------------ÉÏÃæÊÇÔÚT-sqlÖеÄÓï¾ä
ÕâÑù£¬¾Í°ÑÕâ¸öExcel¹¤×÷±íÍêÕûµÄµ¼Èëµ½Sqlµ±Ç°Êý¾Ý¿âϵÄNewTableµÄ±íÖÐÁË¡£
Èç¹ûÏëµ½VBÀïÃæÊ¹Óã¬ÔòÁ¬½Óµ½Õâ¸öÊý¾Ý¿â£¬²¢ÇÒʹÓÃExcuteÖ´ÐÐÉÏÃæµÄT-SQLÓï¾ä¼´¿É¡£
Ïà¹ØÎĵµ£º
-- ±íµÄ½á¹¹ area
DROP TABLE area;
CREATE TABLE area (
id int NOT NULL ,
areaID int NOT NULL,
area varchar(200) NOT NULL,
fatherID int NOT NULL,
PRIMARY KEY (id)
)
DROP TABLE city;
CREATE TABLE city select
id int NOT NULL ......
Êý¾Ý¿âsqlµÄÌØÊâ×Ö·û£º
1£©µ¥ÒýºÅ’£ºÀýÈçstring a = “this is marry’s book.”;
ʹÓÃinsertʱ¾Í»á³ö´í¡£
½â¾ö£ºa= a.Replace("'","' ......
Èë Êƪ
Èç¹ûÄãÒÔǰûÊÔ¹ýSQL×¢ÈëµÄ»°£¬ÄÇôµÚÒ»²½ÏȰÑIE²Ëµ¥=>¹¤¾ß=>InternetÑ¡Ïî=>¸ß¼¶=>ÏÔʾÓѺà HTTP ´íÎóÐÅÏ¢Ç°ÃæµÄ¹´È¥µô¡£·ñÔò£¬²»ÂÛ·þÎñÆ÷·µ»ØÊ²Ã´´íÎó£¬IE¶¼Ö»ÏÔʾΪHTTP 500·þÎñÆ÷´íÎ󣬲»ÄÜ»ñµÃ¸ü¶àµÄÌáʾÐÅÏ¢¡£
µÚÒ»½Ú¡¢SQL×¢ÈëÔÀí
ÒÔÏÂÎÒÃÇ´ÓÒ»¸öÍøÕ¾www.19cn.com¿ªÊ¼£¨×¢£º±¾ÎÄ·¢±íǰÒÑÕ÷µ ......
Ò»£ºSQL Loader µÄÌØµã
oracle×Ô¼º´øÁ˺ܶàµÄ¹¤¾ß¿ÉÒÔÓÃÀ´½øÐÐÊý¾ÝµÄÇ¨ÒÆ¡¢±¸·ÝºÍ»Ö¸´µÈ¹¤×÷¡£µ«ÊÇÿ¸ö¹¤¾ß¶¼ÓÐ×Ô¼ºµÄÌØµã¡£
±ÈÈç˵expºÍimp¿ÉÒÔ¶ÔÊý¾Ý¿âÖеÄÊý¾Ý½øÐе¼³öºÍµ¼³öµÄ¹¤×÷£¬ÊÇÒ»ÖֺܺõÄÊý¾Ý¿â±¸·ÝºÍ»Ö¸´µÄ¹¤¾ß£¬Òò´ËÖ÷ÒªÓÃÔÚÊý¾Ý¿âµÄÈȱ¸·ÝºÍ»Ö¸´·½Ãæ¡£ÓÐ×ÅËٶȿ죬ʹÓüòµ¥£¬¿ì½ÝµÄÓŵ㣻ͬʱҲÓÐһЩȱµ ......
´ÓÍøÉÏËѼ¯µ½µÄVB´úÂ룬ÓÃEXE·½Ê½ÊµÏÖÁËÔ¶³Ì×¢È룬²»¹ýÔÚ·´²¡¶¾Èí¼þµÄ±£»¤Ï£¬ÓпÉÄܵ¼ÖÂ×¢Èëʧ°Ü¡£×ªÌùÕâ¸ö´úÂ룬½ö¹©´ó¼ÒѧϰºÍ²Î¿¼¡£
Ò»¡¢´°¿Ú´úÂ룺
Option Explicit
Private Sub cmdLock_Click()
If LockKeyboard(True) Then
cmdLock.Enabled = False
cmdUnLock.Enabled = Tr ......