Transferring Information from excel to SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bboyhoops
    New Member
    • Dec 2013
    • 1

    Transferring Information from excel to SQL

    My question is concerning “Recordsets”. Currently I am receiving some information in Excel and I would like to transfer that information into SQL database.
    From my understanding I need to setup up a connection (currently using ADODB for my connection) . I am unaware of how to get the information from Excel into the” Recordset” (either by copying or other methods) and sending it to my SQL database. I’m fairly new to this, do you have any suggestions??
    This is what I have so far…
    Dim rs As ADODB.Connectio n
    Set rs = New ADODB.Connectio n
    Dim strConn As String
    strConn=” PROVIDER=SQLOLE DB;"
    strConn = strConn & "DATA SOURCE=MRPSERVE R\ATE;INITIAL CATALOG=ATEstrC onn = strConn & "INTEGRATED SECURITY=sspi;"
    Dim rsDB1 As ADODB.Recordset
    Set rsDB1 = New ADODB.Recordset

    The above code has not worked for me..

    2) I am not able to add a "project reference" I always get a registry error. I've searched online for solutions but not able to find one. Which further makes me question if I have Microsoft.JET.O LEDB.4.0 (I've seen most connections use this driver)
    3) I also need to address the Loop within the Recordset. since the recordset will represent a value/position and receiving the information in the Excel file I have several columns
Working...