|
View previous topic :: View next topic |
Author |
Message |
user24
Joined: 11 Sep 2002 Posts: 2
|
Posted: Thu Sep 12, 2002 4:18 am Post subject: |
|
|
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 ?
[ This Message was edited by: user24 on 2002-09-12 04:19 ]
[ This Message was edited by: user24 on 2002-09-12 06:17 ] |
|
Back to top |
|
|
simonl
Joined: 03 Apr 2002 Posts: 49
|
Posted: Thu Sep 12, 2002 2:52 pm Post subject: |
|
|
Change data type char to varchar or nvarchar. |
|
Back to top |
|
|
user24
Joined: 11 Sep 2002 Posts: 2
|
Posted: Mon Sep 16, 2002 4:27 am Post subject: |
|
|
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... |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Sep 16, 2002 8:58 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|