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 

Delphi6, DbExpress & listing MySQL databases

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





PostPosted: Tue Nov 25, 2003 9:23 am    Post subject: Delphi6, DbExpress & listing MySQL databases Reply with quote



Hi all,

How can I list all the databases available for a given user in a MySQL server?
I use dbExpress and a MySQL driver to connect to the MySQL server.

Any suggestions?

Pawel

Back to top
Ross Davis
Guest





PostPosted: Tue Nov 25, 2003 9:38 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote



check out show databases

"Pawel" <grajewsp (AT) webmedia (DOT) pl> wrote

Quote:
Hi all,

How can I list all the databases available for a given user in a MySQL
server?
I use dbExpress and a MySQL driver to connect to the MySQL server.

Any suggestions?

Pawel




Back to top
paladin
Guest





PostPosted: Tue Nov 25, 2003 10:08 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote




here's how I do it.

-paladin


procedure Tmain.LoadDbaseList(Sender: TObject);
begin // get list of databases (directories) into dropdown combobox
SQLDataSet1.Active := FALSE;
SQLConnection1.Execute('show databases', nil, addr(SQLDataSet1));
ComboBox1.Items.Clear;
SQLDataSet1.First;
while not SQLDataSet1.EOF do begin
ComboBox1.Items.Add(SQLDataSet1.Fields[0].AsString);
SQLDataSet1.Next;
end;
SQLDataSet1.Active := FALSE;
end;


Back to top
paladin
Guest





PostPosted: Wed Nov 26, 2003 4:37 am    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote

hmmmmm,

I am trying to post an example, but I am getting really strange
results. Consider this post a test.

-paladin

"Pawel" <grajewsp (AT) webmedia (DOT) pl> wrote

Quote:
Hi all,

How can I list all the databases available for a given user in a MySQL server?
I use dbExpress and a MySQL driver to connect to the MySQL server.

Any suggestions?

Pawel




Back to top
paladin
Guest





PostPosted: Wed Nov 26, 2003 4:41 am    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote


"Pawel" <grajewsp (AT) webmedia (DOT) pl> wrote

Quote:
Hi all,

How can I list all the databases available for a given user in a MySQL server?
I use dbExpress and a MySQL driver to connect to the MySQL server.

Any suggestions?

Pawel

ok, another try.

procedure Tmain.LoadDbaseList(Sender: TObject);
begin // get list of databases (directories) into dropdown combobox
SQLDataSet1.Active := FALSE;
SQLConnection1.Execute('show databases', nil, addr(SQLDataSet1));
ComboBox1.Items.Clear;
SQLDataSet1.First;
while not SQLDataSet1.EOF do begin
ComboBox1.Items.Add(SQLDataSet1.Fields[0].AsString);
SQLDataSet1.Next;
end;
SQLDataSet1.Active := FALSE;
end;



Back to top
paladin
Guest





PostPosted: Wed Nov 26, 2003 4:47 am    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote

yikes. I think I need an exorcism. everytime I try to paste
a paragraph of code in from Delphi, it makes an attachment
of everything past the first line?? An attachment that is empty??

I've never had this problem before? Can someone enlighten me?






Back to top
Pawel
Guest





PostPosted: Thu Nov 27, 2003 5:22 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote

Użytkownik "paladin" <pal (AT) newsgroups (DOT) com> napisał:
Quote:
yikes. I think I need an exorcism. everytime I try to paste
a paragraph of code in from Delphi, it makes an attachment
of everything past the first line?? An attachment that is empty??

It's a known bug of the Outlook Express. Your post is ok, but Outlook is
unable to show it - it's because of the "begin" line.

pg


Back to top
Pawel
Guest





PostPosted: Thu Nov 27, 2003 5:25 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote

"paladin" <pal (AT) newsgroups (DOT) com>:
Quote:
How can I list all the databases available for a given user in a MySQL
server?
I use dbExpress and a MySQL driver to connect to the MySQL server.

procedure Tmain.LoadDbaseList(Sender: TObject);
begin // get list of databases (directories) into dropdown combobox
SQLDataSet1.Active := FALSE;
SQLConnection1.Execute('show databases', nil, addr(SQLDataSet1));
ComboBox1.Items.Clear;
SQLDataSet1.First;
while not SQLDataSet1.EOF do begin
ComboBox1.Items.Add(SQLDataSet1.Fields[0].AsString);
SQLDataSet1.Next;
end;
SQLDataSet1.Active := FALSE;
end;

The problem persists: to execute that code, I need an exact name of at least
one database present on the MySQL server, and that's what I want to avoid. I
know, that the "mysql" database always exists on every MySQL server, but I
doesn't mean, that every user has granted access rights to connect to it.

Any other suggestions?

pg


Back to top
paladin
Guest





PostPosted: Fri Nov 28, 2003 8:20 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote


"Pawel" <grajewsp (AT) webmedia (DOT) pl> wrote

Quote:
Użytkownik "paladin" <pal (AT) newsgroups (DOT) com> napisał:
yikes. I think I need an exorcism. everytime I try to paste
a paragraph of code in from Delphi, it makes an attachment
of everything past the first line?? An attachment that is empty??

It's a known bug of the Outlook Express. Your post is ok, but Outlook is
unable to show it - it's because of the "begin" line.

pg


thankyou. obviously it posted since it was in your reply. So what you
are asking is how do you "get around" needing to know (and have permissions for)
at least one database name so that delphi connection component will connect in the
first place.

In my limited experience (dbX D6, D7) I think this is a [yet another] limitation of
the driver supplied by Borland. I don't remember a QC entry asking for this to
be fixed, so perhaps you'd like to enter one. but....

Be warned: many complaints about data-handling components (eg. dbexpress, datasnap)
haved languished for 2 major releases, and nearly 2 full years, without:

1. fixes or workarounds supplied by borland
2. source code supplied by borland
3. any tactical planning advice whatsoever to the developers about what (or when) they *will* do

if you really, really want to work hard and do this, you might consider downloading
the header translation found here: http://www.fichtner.net/delphi/mysql and writing a
low-level interrogation yourself. Download his test-project (mysql_test.zip) to see
an example of listing all databases without borland components. This works (for me)
under both D6 and D7.

good luck!
paladin




Back to top
Pawel
Guest





PostPosted: Fri Nov 28, 2003 10:12 pm    Post subject: Re: Delphi6, DbExpress & listing MySQL databases Reply with quote

"paladin" <pal (AT) newsgroups (DOT) com>:
Quote:
In my limited experience (dbX D6, D7) I think this is a [yet another]
limitation of
the driver supplied by Borland. I don't remember a QC entry asking for this
to
be fixed, so perhaps you'd like to enter one. but....

Be warned: many complaints about data-handling components (eg. dbexpress,
datasnap)
haved languished for 2 major releases, and nearly 2 full years, without:

Uhm... I thought I could do it using dbExpress only, without using any
low-level interfaces (like the proposed MySQL client library), but now I see
it's rahter impossible... :(

Pawel


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) 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.