C/ODBC And Apostrophes (Native Navision DB)

Hi, I’m using C/ODBC to perform some queries on a native Navision DB table, but I’m having problems when I want to search a field for a string containing an apostrophe, e.g. : SELECT “Tablet Drawing” FROM “Sales Line” WHERE (“Tool Job” = ‘1133’‘AS’) As you can see I’ve tried to replace the apostrophe with 2 apostrophes as you would with SQL Server but this gives an error. If you just leave it as a single apostrophe you get a different error. Any ideas? Thanks, Jonathan

Hi Jonathan. its pretty importat to know which program you are using. In this case it looks like you are using SQL commands, is this actually VB running in Excel or Access or something, or is it just pure SQL. In any case, not sure I can help much, since I avoid ODBC like the plague. First thing you are going to need to check is how you have mapped special charachters in the C/ODBC setup.

Hi David, I’m using ADO 2.8 from within Visual Basic 6.0. I’m using the parameter IT=All Characters in the C/ODBC connection string which I guess means everything is passed through unchanged.

Sorry, the string conversion only relates to the field names, not the contents. [V]