connection dialog
connection dialog
Hello,
At runtime I don't know which database server is used, therefore I want to use the connection dialog component. But it is very annoying for a user to repeat the connection process for every start of application. What's best practice for this situation (please with short explanation of detail steps)? I think there should be a way to fully automate this complete connection process, for example storing connection values in registry, because it's often the same for every project.
In this context, is there a possibility to use the connection dialog which is available at design time, because it supports also the server specific options (for example, how to provide windows authentification for sql-server with the default connection dialog) ?
P.S. I can't decide which option depends on another option, for example, when I use windows authentication for sql server there's no need for a Username. For this case I know that but what about connections to other databases? I guess, there's really a need for a developer to get protected from all of these problems.
At runtime I don't know which database server is used, therefore I want to use the connection dialog component. But it is very annoying for a user to repeat the connection process for every start of application. What's best practice for this situation (please with short explanation of detail steps)? I think there should be a way to fully automate this complete connection process, for example storing connection values in registry, because it's often the same for every project.
In this context, is there a possibility to use the connection dialog which is available at design time, because it supports also the server specific options (for example, how to provide windows authentification for sql-server with the default connection dialog) ?
P.S. I can't decide which option depends on another option, for example, when I use windows authentication for sql server there's no need for a Username. For this case I know that but what about connections to other databases? I guess, there's really a need for a developer to get protected from all of these problems.
To solve the problem you should use the TUniConnectDialog component that saves connection parameters in Registry. If you don't need to show this dialog more than one time in application, you can set the TUniConnection.LoginPrompt property to False after establishing connection.
Also you can use connection dialog at design time by double-clicking the TUniConnection component.
Also you can use connection dialog at design time by double-clicking the TUniConnection component.
Is it possible to get the information from ConnectDialog direct without registry and to define, for example, the provider name before opening the dialog?Dimon wrote:To solve the problem you should use the TUniConnectDialog component that saves connection parameters in Registry. If you don't need to show this dialog more than one time in application, you can set the TUniConnection.LoginPrompt property to False after establishing connection.
Also you can use connection dialog at design time by double-clicking the TUniConnection component.
There's nothing shown about my problem. That's only a demonstration about using an own dialog class.Dimon wrote:You can look at the example of customizing the UniDAC connect dialog in the ConnectDialog demo of UniDAC demo project.
When I use the connection editor at design time from unidacconnection component it shows me a complete server list. How is it possible to get such a list at runtime (the connect dialog component shows only the local instance) ?
As I said, the GetServerLists returns only the local server, but not all reachable server in the network (contrary to the connection editor at design time). Is there a possibility to get ALL available server exactly like the connection dialog at design time?Dimon wrote:You need to use your own ConnectDialog (by the example of UniDAC demo).
The TUniConnectDialog.GetServerLists method returns the server list.
This implementation with an own dialog class is no good idea, because I need only the values from uniconnection, for example, the server list or all possible databases etc...
I've a dialog with many fields and the connection parameters are only a few of these fields. I need also full access if and when fields should be enabled. Also, why are these parameters stored in registry?!
Why isn't that solved with methods, why in an own class implementation?
I guess the only solution for me is to use the default login dialog which is shown by a button and read the values from registry. Is it possible to predefine the connection dialog with values (for allow editing of an database saved connection) and where are these values stored?
I've a dialog with many fields and the connection parameters are only a few of these fields. I need also full access if and when fields should be enabled. Also, why are these parameters stored in registry?!
Why isn't that solved with methods, why in an own class implementation?
I guess the only solution for me is to use the default login dialog which is shown by a button and read the values from registry. Is it possible to predefine the connection dialog with values (for allow editing of an database saved connection) and where are these values stored?
Not this, I meant the complete way. For example how can I provide windows authentication for MS SQL Server with an own connection dialog?Dimon wrote:Why does this way not solve the problem?Dimon wrote:To solve the problem set the TUniConnectDialog.UseServerHistory property to False and the TUniConnectDialog.Connection.Connected property to True.