Results 1 to 4 of 4

Thread: [RESOLVED] INSERT statement is not working...

Threaded View

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    [RESOLVED] INSERT statement is not working...

    I am getting an error with this code. It says there is a syntax error near "," which is pretty useless. I am almost positive is has to do with the NULL statements.

    VB Code:
    1. Dim sqlinsert As String
    2. sqlinsert = "INSERT INTO PENDINGART ([CUST], [PRTD], [CUSTART], [DESC], [DATEREC], [SIZE], [DATERQD], [STATUS], [SAMPLENEEDED], [NOTES]) VALUES("
    3. sqlinsert = sqlinsert & "'" & XCUST & "', "
    4. sqlinsert = sqlinsert & "'" & Xprtd & "', "
    5. sqlinsert = sqlinsert & "'" & Xcustart & "', "
    6. sqlinsert = sqlinsert & "'" & xDESC & "', "
    7. If IsDate(XDATEREC) Then
    8.         sqlinsert = sqlinsert & "'" & XDATEREC1 & "', "
    9. Else
    10.         sqlinsert = sqlinsert & Null & ", "
    11. End If
    12. sqlinsert = sqlinsert & "'" & xSIZE & "', "
    13. If IsDate(Xdaterqd) Then
    14.         sqlinsert = sqlinsert & "'" & XDATERQD1 & "', "
    15. Else
    16.         sqlinsert = sqlinsert & Null & ", "
    17. End If
    18. sqlinsert = sqlinsert & "'" & xstatus & "', "
    19. sqlinsert = sqlinsert & "'" & XSAMPLENEEDED & "', "
    20. sqlinsert = sqlinsert & "'" & xnotes & "') "
    21. CnxnTechSQL.Execute sqlinsert
    Last edited by Pasvorto; Sep 15th, 2005 at 01:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width