将excel文件中的数据导入导出至SQL数据库

<%

dim conn,connstr

connstr="Driver={sql server};uid=sa;pwd=*****;database=tushu;SERVER=SQL2005"

set conn=server.createobject("ADODB.CONNECTION")

conn.open connstr  
 
'此处为excel2007,用'Microsoft.ACE.OLEDB.12.0',如为97-2003,用'Microsoft.Jet.OLEDB.4.0'

sql = "SELECT * into newtable FROM OpenDataSource( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=""c:\book.xls"";User ID=Admin; Password=; Extended properties=Excel 5.0')...[sheet1$]"
conn.execute(sql)
conn.close
set conn = nothing

%>

你可能感兴趣的:(excel,sql,sql,server,properties,database,数据库)