将excel 文件导入access数据表

 

Dim  conn  As   New  OleDbConnection(My.Settings.ConnStr  &  My.Application.Info.DirectoryPath  &   " datawarehouse.mdb "
Dim  comm  As  OleDbCommand  =  conn.CreateCommand 
comm.CommandText 
=   " insert into tablename select * from [excel 8.0;HDR=yes;IMEX=1;database= " d: upload.xls].[sheet1$] "  
conn.Open() 
comm.ExecuteNonQuery()         

 

你可能感兴趣的:(Excel,database,Access)