阅读背景:

将数据从EXCEL插入数据库

来源:互联网 
 ' Create the Connection and Recordset objects.
    Set conn = New ADODB.Connection
    Set rs = New ADODB.Recordset
    Dim val As String
    val = Range("B5").Value


    ' Open the connection and execute.
    conn.Open sConnString

    Dim item As String
    item = "INSERT INTO [IndustrialComp].[dbo].[Header]("
    item = item & "  [server_name] "

    item = item & "  )Values("
    item = item & "  '" & val & "')"


    conn.Execute item
 ' Create the Connection and Recordset objects.



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: