Problem With UniConnectDialog

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mmx110
Posts: 8
Joined: Fri 31 May 2013 11:14

Problem With UniConnectDialog

Post by mmx110 » Fri 31 May 2013 11:23

Hi and Good Time!
I want to ask a question about UniConnectDialog...
when I set StoreLogInfo to False and Try To Execute Dialog and change the serevername after the pushing conect button rise an error rises again with the name of "Last Server". How I can Clear Old Server Name Value and set the New Server Name across the UniConnectDialog select combobox?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Problem With UniConnectDialog

Post by AlexP » Fri 31 May 2013 13:38

Hello,

The StoreLogInfo property doesn't affect a server to be connected, this property is responsible for storing successful connection parameters to the registry. Try setting the UniConnectDialog1.UseServerHistory property to False and connecting to the server once more.

mmx110
Posts: 8
Joined: Fri 31 May 2013 11:14

Re: Problem With UniConnectDialog

Post by mmx110 » Fri 31 May 2013 14:35

thanks for reply Alex!
I Wrote the code:
UniConnectDialog1.UseServerHistory:=False;
but I Got This Error when changing database Name:
"Multiple-Step OLE DB Operation generated errors. Check each OLE DB Status value,if available.No work was Done."

AndreyZ

Re: Problem With UniConnectDialog

Post by AndreyZ » Mon 03 Jun 2013 08:17

I cannot reproduce this problem. Please specify the following:
- the exact version of UniDAC. You can learn it from the About sheet of TUniConnection Editor;
- the exact version of your IDE;
- the exact version of SQL Server server and client. You can learn it from the Info sheet of TUniConnection Editor.
Also, you can try using the latest UniDAC version 5.0.1 and check if the problem persists.

mmx110
Posts: 8
Joined: Fri 31 May 2013 11:14

Re: Problem With UniConnectDialog

Post by mmx110 » Wed 05 Jun 2013 16:14

1- UniDac Version 4.0.2
2- IDE is Delphi 7
3- SQLServer is 2008 R2
Many Kind of you if show me exact sample Code for this situation
Regards

AndreyZ

Re: Problem With UniConnectDialog

Post by AndreyZ » Thu 06 Jun 2013 08:56

Unfortunately, I still cannot reproduce the problem. Please try the following:
- open Delphi 7;
- create a new application;
- drop the TUniConnection, TUniConnectDialog, TSQLServerUniProvider, and TButton component;
- double click on Button1 and write the following code:

Code: Select all

UniConnection1.ConnectDialog := UniConnectDialog1;
UniConnection1.Open;
- run the application and click Button1;
- choose the "SQL Server" provider from the Provider drop-down list;
- input the correct user name and password to the User Name and Password text boxes;
- choose your server from the Server drop-down list;
- choose your database from the Database drop-down list;
- click the Connect button.
Do you encounter any problems using such approach?

mmx110
Posts: 8
Joined: Fri 31 May 2013 11:14

Re: Problem With UniConnectDialog

Post by mmx110 » Thu 06 Jun 2013 14:12

Dear Andrey Thanks for your attention!
I wrote a code in DataModule OnCreat Event as Bellow:

UniConnectDialog1.UseServerHistory:=False;
UniConnection1.Connected:=True;
SystemUserQuery.Open;
AccNameQuery.Open;
CodingQuery.Open;
AccYearQuery.Open;
CodingQuery.Open;

and I assigned a Database Name From SQLServer to UniConnection By Default
in normal situation Every thing is oK!
but I want write a code for OnConection Lost or OnError Event
For time that Default Dtabase Dose not Found Or Have Error in Connection.
I Wote UniConnection1.OnError Some code as bellow:

try
begin
UniConnection1.Disconnect;
UniConnectDialog1.UseServerHistory:=False;
UniConnectDialog1.Execute;
UniConnection1.Connect;
end;
except on E: Exception do
begin
ShowMessage(E.ClassName+' Error in Conection With Database : '+E.Message);
if Not(UniConnectDialog1.Execute) then Application.Terminate;
end;
end;

SO Application show me that Error when I manually change Database state to offline.
and can not to select other server or related database with different name
on UniConnectDialog.

AndreyZ

Re: Problem With UniConnectDialog

Post by AndreyZ » Fri 07 Jun 2013 09:08

Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. We will notify you when we have any results.

AndreyZ

Re: Problem With UniConnectDialog

Post by AndreyZ » Wed 10 Jul 2013 12:17

We have fixed this problem. This fix will be included in the next UniDAC build.

Post Reply