Using quote charactes in ODBC

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Using quote charactes in ODBC

Post by plambrecht »

Hi,

When performing test's, I have some test that have the single quote character in them.
All tests are logged in ODBC using this query :

Insert into hmlog (eventtime, testname, status, reply, comment1, testmethode) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', '%CommentLine1%', '%TestMethod%')

This is what I get in the systemlog of HM: (erased the password)
25/05/2004 13:30:36 ODBC log error. Error code: 4294967295 ([Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Connect to d'Light', 'Bad', '14', '[C:\Program Files\Cisco Systems\VPN Client\vpnclient.exe] connect d'light user icorda pass ****''.) Logging initiated by "Connect to d'Light" test.

Can I somehow change it so that the ' characters are preceded with a \ when putting into the SQL query ?
My guess is that this is a programmatic issue, and not a config issue.

regards

Pieter

PS: the default sql query string is missing ' around %datetime%
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Can I somehow change it so that the ' characters are preceded with a \ when putting into the SQL query ?
Sorry, you cannot do that. We will try to improve this function in next version.
Probably you may use ` (character #96) instead of ' (character #39) in test name.
PS: the default sql query string is missing ' around %datetime%
Thanks for the tip.

Regards
Alex
Post Reply