I am trying to list all Database in an SQL Server. Can someone give me a hint of how should i do this. using QODBC mode in QSqlDatabase?
I am very new to database stuff so please be gentle if my question is really dumb..
baray98
Printable View
I am trying to list all Database in an SQL Server. Can someone give me a hint of how should i do this. using QODBC mode in QSqlDatabase?
I am very new to database stuff so please be gentle if my question is really dumb..
baray98
Another answer could be this one ( I'm using SQL Server 2000 and SHOW DATABASES doesn't work for me )
I use a select like this :
Code:
SELECT NAME FROM master..sysdatabases WHERE ( status & 512 = 0 )
NOTE : status 512 means "connected". You can have a lot of databases, but some of them could be disconnected...