BDE Migration to UniDAC with SQL Server 2005

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
willmom
Posts: 2
Joined: Thu 14 Jul 2011 19:09
Location: Brazil

BDE Migration to UniDAC with SQL Server 2005

Post by willmom » Thu 14 Jul 2011 19:56

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!!

AndreyZ

Post by AndreyZ » Fri 15 Jul 2011 06:02

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

willmom
Posts: 2
Joined: Thu 14 Jul 2011 19:09
Location: Brazil

Post by willmom » Fri 15 Jul 2011 13:01

Thank you very much

AndreyZ

Post by AndreyZ » Fri 15 Jul 2011 13:29

Feel free to contact us if you have any further questions about UniDAC.

Post Reply