I use a SQL-Server-Table to write LOG-Messages.
The QUERY-String is "Insert into tbl_Hostmon_Log (Datetime, testname, status, reply, SimpleStatus) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', '%SimpleStatus%')"
This works fine, but if there ist a _'_ in the Reply-Field of HM (in NT-Log-Test very often), the QUERY fails because the _'_ is for SQL a Text-Delimeter.
Is there any Workaround ?
<font size=-1>[ This Message was edited by: user24 on 2002-09-12 04:19 ]</font>
<font size=-1>[ This Message was edited by: user24 on 2002-09-12 06:17 ]</font>
Advanced Logs: ODBC Insert with _'_ Char
Thats not the Solution.
The Reply-Field of the SQL-Server-Table is already Text-Type.
The Problem is:
The QUERY-String is "Insert into tbl_Hostmon_Log (Datetime, testname, status, reply, SimpleStatus) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', '%SimpleStatus%')"
The Macro of HM replaces the Field-Names with the Value.
If the Reply-Field contains "This is a 'Test' for me", then the QUERY-String looks like:
"Insert into tbl_Hostmon_Log (... VALUES ('...', '...', '...', 'This is a 'Test' for me', '...')".
The ' near "Test" produce the Error.
If HM can konvert ' to '', then i think it Works.
Help me please...
The Reply-Field of the SQL-Server-Table is already Text-Type.
The Problem is:
The QUERY-String is "Insert into tbl_Hostmon_Log (Datetime, testname, status, reply, SimpleStatus) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', '%SimpleStatus%')"
The Macro of HM replaces the Field-Names with the Value.
If the Reply-Field contains "This is a 'Test' for me", then the QUERY-String looks like:
"Insert into tbl_Hostmon_Log (... VALUES ('...', '...', '...', 'This is a 'Test' for me', '...')".
The ' near "Test" produce the Error.
If HM can konvert ' to '', then i think it Works.
Help me please...
Please try the patch at http://www.ks-soft.net/download/hm327.zip
This version can replace any characters in "Reply" field to any other. Just add 2 lines in hostmon.ini file, section [Misc].
[Misc]
SubstituteFieldFrom= '
SubstituteFieldTo = "
BTW you can replace several characters. E.g. if you want to replace '1' to 'A', '2' to 'B', '3' to 'C', add follow lines:
SubstituteFieldFrom= 123
SubstituteFieldTo = ABC
Regards
Alex
This version can replace any characters in "Reply" field to any other. Just add 2 lines in hostmon.ini file, section [Misc].
[Misc]
SubstituteFieldFrom= '
SubstituteFieldTo = "
BTW you can replace several characters. E.g. if you want to replace '1' to 'A', '2' to 'B', '3' to 'C', add follow lines:
SubstituteFieldFrom= 123
SubstituteFieldTo = ABC
Regards
Alex