Page 1 of 1

connection to SQL Server 2005 Express

Posted: Thu 13 Nov 2008 14:32
by Cogito
Hi,

I've no installation of sql express edition, but I need a compilation for that. How are the configuration parameters for TMSConnection component to connect to SQL Server Express with windows authentication?

Thanks.

Posted: Thu 13 Nov 2008 15:37
by Dimon
To connect to SQL Server Express you should set the same TMSConnection properties as for standard SQL server, like this: Server, Database, Username, Password.
To use Windows authentication you should set the TMSConnection.Authentication property to auWindows.

Posted: Thu 13 Nov 2008 17:53
by Cogito
Dimon wrote:To connect to SQL Server Express you should set the same TMSConnection properties as for standard SQL server, like this: Server, Database, Username, Password.
To use Windows authentication you should set the TMSConnection.Authentication property to auWindows.
Does it work with localhost as server name?? (Nothing with .\SQLExpress... like .NET connection?)

Can you give me a sample how I can read the connection params at runtime (especially which event should be used to read the params an what file type should it be)?

Posted: Mon 17 Nov 2008 14:49
by Dimon
Cogito wrote:Does it work with localhost as server name?? (Nothing with .\SQLExpress... like .NET connection?)
Yes, for this you can set the TMSConnection.Server property to '.\SQLExpress'.
Cogito wrote:Can you give me a sample how I can read the connection params at runtime (especially which event should be used to read the params an what file type should it be)?
Please specify what params do you mean?

Posted: Tue 18 Nov 2008 10:34
by Cogito
Cogito wrote:Can you give me a sample how I can read the connection params at runtime (especially which event should be used to read the params an what file type should it be)?
Please specify what params do you mean?[/quote]

I mean the logon parameter (server, database etc..). Is an ini-file ok or xml and when should they be read, in the oncreate event of datamodul?

Posted: Thu 20 Nov 2008 07:04
by Dimon
To set the connection parameters at run-time you can use the following code:

Code: Select all

  MSConnection.Server := '.\SQLExpress';
  MSConnection.Database := 'DatabaseName'
  MSConnection.Authentication := auWindows;
TMSConnection does not allow to read connection parameters from file or from registry, but you can do it yourself by any convenient way. This task does not belong to SDAC tasks.