ODBC logging failes with a ' char

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:

ODBC logging failes with a ' char

Post by plambrecht »

Alex,

In my system log, I sometimes get this error:

Code: Select all

20/12/2004 4:20:44 ODBC log error. Error code: 4294967295 ([Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Transaction'.) Logging initiated by "ICORDA-FS2, Eventlog Application Warning" test.

Code: Select all

18/12/2004 4:20:16   ODBC log error. Error code: 4294967295 ([Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'Computer'.) Logging initiated by "ICORDA-FS2, Eventlog Application Error" test.  
I Use Advance ODBC logging with this Query:

Code: Select all

Insert into RawTestData (DeviceID, DataTestID, TestDate, TestValue, TestIntegerValue, TestStatus, TestExtra1) VALUES ('%FCommentLine4%', '%CommentLine1%', GetDate(), '%Reply_CStyle%', '%Reply_Integer%', '%StatusID%', '%CommentLine2%')
the Reply I have for the test is this one:

Code: Select all

SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan 'DB Maintenance Plan1'' (0x77CF9071E1680343A3FD2E31BF338C08) - Status: Failed - Invoked on: 2004-12-20 00:00:00 - Message: The job failed. The Job was invoked by Schedule 19 (Schedule 1). The last step to run was step 1 (Step 1).

Code: Select all

'Computer Associates Licensing -39WC - License Failure. Please contact your account representative to obtain a new license. LRF=39WC, 00025507e53c, PC_1586_2_2394, ICORDA-FS2, 3'

The problem is that with Microsoft SQL a single quote has to be replace with two single quotes and not a backslashed single quote...

Pieter
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Post by plambrecht »

Hi,

An ideas ?

Pieter
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Ideas? Not yet (except another new variable). Trying to find MS SQL manual that describes all SQL rules...

Reards
Alex
User avatar
plambrecht
Posts: 151
Joined: Wed May 19, 2004 8:11 am
Location: Belgium
Contact:

Post by plambrecht »

maybe a start here :

http://msdn.microsoft.com/library/defau ... b_dktu.asp
* A single quote must be escaped with another single quote.
* A double quote does not need to be escaped with another double quote unless the query is in Visual Basic Scripting Edition (VBScript) code.

or here
http://msdn.microsoft.com/library/defau ... sqlado.asp


greetz

Pieter
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Ok, this update should fix the problem: www.ks-soft.net/download/hm494.zip

This is "unofficial" update, means there are some undocumented modifications. It was tested and seems to be working fine but it was not tested much. So, better if you keep your eyes on it for a while.

Regards
Alex
Post Reply