GetDatabaseNames: SQL-Server problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
formi
Posts: 39
Joined: Thu 17 Apr 2008 13:01

GetDatabaseNames: SQL-Server problem

Post by formi » Fri 07 Dec 2012 10:58

Hi

I noticed that when I call UniConnection1.GetDatabaseNames(..) then SQL Server reaches a stae where it always starts the databases.

Just wrote an example nothing doing than calling UniConnection1.GetDatabaseNames once. After this the Windows-Event Viewer shows many events "database xy started". This stops only after restarting the sqlServer-Service.

Have I to call another method or is this a bug? Installed version: UniDAC 4.5.9 for D XE2

Peter

AndreyZ

Re: GetDatabaseNames: SQL-Server problem

Post by AndreyZ » Fri 07 Dec 2012 12:17

Hello,

Most probably, these events occur because the AutoClose property of your database is set to ON on the server. For more information about the AutoClose property, please read the following articles:
http://msdn.microsoft.com/en-us/library/ms135094.aspx
http://msdn.microsoft.com/en-us/library/ms190249.aspx
To avoid this problem, you should set the AutoClose property to OFF. For this, you can use the following SQL statement:

Code: Select all

ALTER DATABASE YourDatabaseName SET AUTO_CLOSE OFF;

formi
Posts: 39
Joined: Thu 17 Apr 2008 13:01

Re: GetDatabaseNames: SQL-Server problem

Post by formi » Fri 07 Dec 2012 12:31

I didn't test if that is the problem but if I want to know which databases are on the server this option doesn't seem useful because it is a command that refers to the database. So I prefer to use this command to get the databasenames:

Code: Select all

SELECT name FROM master..sysdatabases WHERE dbid > 6
Peter

AndreyZ

Re: GetDatabaseNames: SQL-Server problem

Post by AndreyZ » Fri 07 Dec 2012 13:14

You can see database names in event messages.

Post Reply