ODBC connection

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
otip
Posts: 9
Joined: Tue Sep 10, 2013 1:28 am

ODBC connection

Post by otip »

Hi all,

I am very new on using HM.

I wanna do a POC on using a SQL DB to store de logs.

I have a test machine (XP) with HM and RCC installed + SQL express 2008.

I have created a DB called hm.
I have a setup an ODBC object (dsn system) and tested it : test is ok.

Then I HostMonitor I open the options window and go to primary logs. I choose DB and provide my odbc object name.

When I click on test I receive a message "Return Code 4294967295 [Microsoft][ODBC SQL Server Driver][SQL Server]Invalied object name 'hm'

providing a login password doesn't change the message.

Any clue ?

Thanks.
otip
Posts: 9
Joined: Tue Sep 10, 2013 1:28 am

Post by otip »

Hi all,

I found the reason was that I had to create myself the table and each of its field myself.
Of course an appropriate database table has to be created before you start using the ODBC logging.
Altough after doing this I still have an error message
string or binary data would be truncated
It apparently concerns the eventtime column that I have defined as datetime as recommended :

Macro variable Field type
%DateTime% datetime or timestamp

Insert into test (eventtime, testname, status, reply, testid, testmethod) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', %TestID%, '%TestMethod%')

I have tried datime and time stamp and it gives me a different error so I beleive the error is there.

But I can't find an other format for this field.

Do you have an idea where I am wrong?

thanks.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Please check and modify field sizes, used for Reply, TestName, etc. in your table.
If some values (e.g. Reply) are larger then field size - they will be truncated.
otip
Posts: 9
Joined: Tue Sep 10, 2013 1:28 am

Post by otip »

yes that was the problem.

The documentation only says CHAR so I had selected this in SqlExpress. However the default size was 10 I have increased it and it was then ok.

I haven't seen this info in the doc.

Thanks.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

The documentation only says CHAR so I had selected this in SqlExpress. However the default size was 10 I have increased it and it was then ok.
I haven't seen this info in the doc.
We do not specify exect field sizes/types and SQL queries for table creation, because ODBC can be used with different databas engines (MSSQL, MySQL, Oracle, even text/csv files).
Also it depends on HostMontor configuration and planned table/database sizes.
Thanks.
You are welcome.
Post Reply