BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Enumerate DataBase

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Daniel
Guest





PostPosted: Wed Jul 06, 2005 3:55 am    Post subject: Enumerate DataBase Reply with quote



Hi,

I am new to database, this is really a stupid question. But I do need
help.

I use the following command want to get list of database.

ADOQuery.SQL.Add('Exec SP_DATABASES');
ADOQuery.Active := True;

Total count is available as AdoQuery.RecordCount, but how can I get the
database name?

for i:=0 to AdoQuery.RecordCount-1 do
begin
//dbList.Add(ADOQuery.Records[i].Name);
AdoQuery.Next;
end;


Back to top
Thomas Steinmaurer
Guest





PostPosted: Wed Jul 06, 2005 6:11 am    Post subject: Re: Enumerate DataBase Reply with quote



Quote:
I am new to database, this is really a stupid question. But I do need
help.

I use the following command want to get list of database.

ADOQuery.SQL.Add('Exec SP_DATABASES');
ADOQuery.Active := True;

Total count is available as AdoQuery.RecordCount, but how can I get the
database name?

for i:=0 to AdoQuery.RecordCount-1 do
begin
//dbList.Add(ADOQuery.Records[i].Name);
AdoQuery.Next;
end;

dbList.Clear;
while not ADOQuery.EOF do
begin
dbList.Add(ADOQuery.FieldByName('DATABASE_NAME').AsString);
ADOQuery.Next;
end;



--
HTH,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2 (NEW!)
Upscene Productions
http://www.upscene.com

Back to top
Daniel
Guest





PostPosted: Wed Jul 06, 2005 7:45 am    Post subject: Re: Enumerate DataBase Reply with quote



Hi, Thomas,

Thanks a lot.

Daniel



"Thomas Steinmaurer" <t.steinmaurer (AT) _no_upscene_spam_ (DOT) com>
???????:42cb7627 (AT) newsgroups (DOT) borland.com...
Quote:
I am new to database, this is really a stupid question. But I do need
help.

I use the following command want to get list of database.

ADOQuery.SQL.Add('Exec SP_DATABASES');
ADOQuery.Active := True;

Total count is available as AdoQuery.RecordCount, but how can I get
the database name?

for i:=0 to AdoQuery.RecordCount-1 do
begin
//dbList.Add(ADOQuery.Records[i].Name);
AdoQuery.Next;
end;

dbList.Clear;
while not ADOQuery.EOF do
begin
dbList.Add(ADOQuery.FieldByName('DATABASE_NAME').AsString);
ADOQuery.Next;
end;



--
HTH,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2 (NEW!)
Upscene Productions
http://www.upscene.com



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.