本文介绍了将数据从MS excel导入到SQL MS访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我尝试过:



Dim xlpath As String

昏暗的用户As String = HttpContext.Current.User.Identity.Name

xlpath = Server.MapPath(〜\ excelFile \)& EXCEL_PATH.FileName

尝试

Kill(xlpath)

Catch

结束尝试



EXCEL_PATH.PostedFile.SaveAs(xlpath)

Dim strConn As String =Provider = Microsoft.ACE.OLEDB.12.0; &安培; 数据来源=& xlpath& ; &安培; Extended Properties = Excel 8.0;

Dim cnnEXCEL As OleDbConnection = New OleDbConnection(strConn)



//

我只能为此编写代码。 
我想要示例代码
解决方案



What I have tried:

Dim xlpath As String
Dim user As String = HttpContext.Current.User.Identity.Name
xlpath = Server.MapPath("~\ExcelFile\") & EXCEL_PATH.FileName
Try
Kill(xlpath)
Catch
End Try

EXCEL_PATH.PostedFile.SaveAs(xlpath)
Dim strConn As String = "Provider = Microsoft.ACE.OLEDB.12.0;" & "Data Source = " & xlpath & ";" & "Extended Properties = Excel 8.0 ;"
Dim cnnEXCEL As OleDbConnection = New OleDbConnection(strConn)

//

I can write code only for this.
I wanted to example code
解决方案


这篇关于将数据从MS excel导入到SQL MS访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-09 01:01