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:
SQL = "INSERT into " & table & " VALUES ('" _ & Replace(strFilepath, "'", """") & "','" _ & Replace(strFileName, "'", """") & "','" _ & Replace(strFileSize, "'", """") & "','" _ & Replace(strArtist, "'", """") & "','" _ & Replace(strTitle, "'", """") & "','" _ & Replace(strAlbum, "'", """") & "','" _ & Replace(strFrequency, "'", """") & "','" _ & Replace(strBitrate, "'", """") & "','" _ & Replace(strLength, "'", """") & "','" _ & Replace(strTrack, "'", """") & "')" Cnn.Execute (SQL)




Reply With Quote