Page 1 of 1

BDE Migration to UniDAC with SQL Server 2005

Posted: Thu 14 Jul 2011 19:56
by willmom
We are planing to migrate from BDE to UniDAC on Delphi 2007 with SQL Server 2005...

I did tests with the version 3 (trial) of UniDac...

The single biggest issue for us was that in the BDE Database component is the connection parameter "HOST NAME".

When my application logs with a particular user at run-time change this parameter to the [Host name + '/' + user that logged in my application] ...

Under Backend (not sure how) the BDE automatically changes the host_name () SQL Server to get [Host name + '/' + user that logged in my application].



Example of how you look after:
-------------------------------------


SELECT host_name() as host_user

Result: "computer01/john"



With that use this information to generate logs in my application through Procedures and Triggers in SQL Server.



Question:
------------


* How can I do this using UniDac???

* If you do not have to do this in UniDac, have how to use a command to set the host_name () as I want?



Thanks in advance!!

Posted: Fri 15 Jul 2011 06:02
by AndreyZ
Hello,

To identify the workstation, you can use the WorkstationID specific option for SQL Server. Here is a code example:

Code: Select all

UniConnection.SpecificOptions.Values['WorkstationID'] := 'computer01/john';
UniQuery.Connection := UniConnection;
UniQuery.SQL.Text := 'SELECT HOST_NAME()';
UniQuery.Open;
ShowMessage(UniQuery.Fields[0].AsString); // here you will see the 'computer01/john' message

Posted: Fri 15 Jul 2011 13:01
by willmom
Thank you very much

Posted: Fri 15 Jul 2011 13:29
by AndreyZ
Feel free to contact us if you have any further questions about UniDAC.