I'm having a terrible time using strings in my SQL statement. If one of the fields contains a ' then I get an syntax error. I've tried several ways to try an fix this, this is the most recent. Any help with this is EXTREMELY appreciated as I have been stuck on this for 4 days now.
VB Code:
  1. SQL = "INSERT into " & table & " VALUES ('" _
  2.     & Replace(strFilepath, "'", """") & "','" _
  3.     & Replace(strFileName, "'", """") & "','" _
  4.     & Replace(strFileSize, "'", """") & "','" _
  5.     & Replace(strArtist, "'", """") & "','" _
  6.     & Replace(strTitle, "'", """") & "','" _
  7.     & Replace(strAlbum, "'", """") & "','" _
  8.     & Replace(strFrequency, "'", """") & "','" _
  9.     & Replace(strBitrate, "'", """") & "','" _
  10.     & Replace(strLength, "'", """") & "','" _
  11.     & Replace(strTrack, "'", """") & "')"
  12.  
  13. Cnn.Execute (SQL)