SIMPLE SQL ? Large insert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jesse07
    New Member
    • Sep 2007
    • 18

    SIMPLE SQL ? Large insert

    my SQL statement works when I do a small part, but I have 83 fields I need to insert into a table in Access and Im try to remember how to do this. I know it is really easy.

    strSQL = "INSERT INTO Table1 " _
    & "(user_comp any, user_fname, user_lname) VALUES " _
    & "('" & arrFill(1) & "', '" & arrFill(2) & "', '" & arrFill(3) & "');"

    but how do I make it multiple lines? When my variables rap to the next line, Im not sure how to correctly code it.

    strSQL = "INSERT INTO Table1 " _
    & "(user_comp any, user_fname,
    user_lname) VALUES " _
    & "('" & arrFill(1) & "', '" & arrFill(2) & "', '" & arrFill(3) & "');"

    Thank you
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Try this:

    Code:
    strSQL = "INSERT INTO Table1 " 
    strSQL = strSQL & "(user_company, user_fname," 
    strSQL = strSQL & "user_lname) VALUES " 
    strSQL = strSQL &  "('" & arrFill(1) & "', '" & arrFill(2) & "', '" & arrFill(3) & "');"
    Good Luck.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You need to concadinate the each line of SQL statment to a variable and finally execute that.

      If using from Vb 6.0 ,you can use the _ (underscore) at the end of each line to go to next line.

      Comment

      Working...