|
Scott Scriver
Starting Member
4 Posts |
Posted - 2001-01-13 : 13:22:00
|
| I cannot seem to find way around this. Here is my code:I have a text file that is comma delimited with quotes around the strings. The Text file looks like this:1,2,3,"FirstName","LastName","NickName"2,3,4,"FirstName","LastName","NickName"EOFI then have a statement that loops through the file, grabs the entire line and puts it in the database:strData = oTS.ReadLineIf LCase(Mid(strData, 1, 3)) <> "eof" ThenSQL = "set quoted_identifier off " + _ "INSERT INTO TABLE (Value1, Value2, Value3, String1, String2, String3) VALUES (" & strData & ")"RunSQL gsConnect, SQLEnd IfAll works great until this:1,2,3,"FirstName","LastName",""Nick" Name"2,3,4,"FirstName","LastName","NickName"Notice Line 1 has quotes around Nick. I get the following error:[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'Nick'.The code handles single quotes just fine, but double quotes, it chokes!Any suggestions? I am trying to avoid having to physically parse the entire line.Thanks! |
|