Board index » delphi » Problem still with my mysql dbexpress app (listing tables)

Problem still with my mysql dbexpress app (listing tables)

Is anyone willing to have a look at my project I am developing using Delphi
6?  The project has one and only one form.
I have posted my project to borland.public.attatchments on this news server.
The post has the subject "{*word*221} Duckys' DBExpress Problem"

The problem I am having is this; I am simply trying to connect to a mysql
server (currently localhost but can be specified) display a list of the
databases and tables in a treeview.<FULL STOP> (And hopefully my aim is when
you select a table the immediate right hand dbgrid shows the properties of
this table.  The dbgrid below it will have a select * from <selected table>
and simply outputs the data for the selected table.  This is not important)

I would just like to know why I cannot display the tables in the treeview.
This is the code:

    SQLConnection1.LoadParamsOnConnect := False;
     SQLConnection1.Params.Values['HostName'] := txt_host.text;
     SQLConnection1.Params.Values['User_Name'] := txt_user.text;
     SQLConnection1.Params.Values['Password'] := txt_pass.text;
     SQLConnection1.Params.Values['Database'] := 'mysql';
     SQLConnection1.Params.Values['DriverName'] := 'MYSQL';
     ShowMessage (SQLConnection1.Params.Values['HostName']);
     ShowMessage (SQLConnection1.Params.Values['User_Name']);
     ShowMessage (SQLConnection1.Params.Values['Password']);
     ShowMessage (SQLConnection1.Params.Values['Database']);
     ShowMessage (SQLConnection1.Params.Values['DriverName']);

     SQLConnection1.Connected := True;.  <----code crashes here

Just ignore the whole MS Access bit this is seperate for now and is not
relevent.

I know that the program is connecting to mysql because (1) I connect to the
mysql server and run a "show processlist" and I get the process in the list
with the user name, (2) my zonealarm firewall asks me if I want to allow
this program to access 127.0.0.1:3306. But somewhere the whole thing is
going wrong

This application will be running on both windows and on linux (after it it
compiled under kylix) so any ideas here to improve functionallity will be
welcomed.

This content is echoed in my attatchments post
--
Thanks lots
{*word*221} Ducky

 

Re:Problem still with my mysql dbexpress app (listing tables)


Hi,

I'm not familiar with the .rar format of your attachment.  Is this a compression
format for Linux?  Do you happen to have a small testcase of the problem that I
can look at in Delphi?

Fyi, running your example worked for me, so there must be more going here.  I'm
using MySQL 3.23.41.  I'm assuming that you're able to connect directly with
TSQLConnection (i.e. w/o code by dropping the component, setting the options,
LibraryName=dbexpmysql.dll, etc.)?  Also, what version of MySQL are you using?

Thanks,

Marilyn

Quote
{*word*221} Ducky wrote:
> Is anyone willing to have a look at my project I am developing using Delphi
> 6?  The project has one and only one form.
> I have posted my project to borland.public.attatchments on this news server.
> The post has the subject "{*word*221} Duckys' DBExpress Problem"

> The problem I am having is this; I am simply trying to connect to a mysql
> server (currently localhost but can be specified) display a list of the
> databases and tables in a treeview.<FULL STOP> (And hopefully my aim is when
> you select a table the immediate right hand dbgrid shows the properties of
> this table.  The dbgrid below it will have a select * from <selected table>
> and simply outputs the data for the selected table.  This is not important)

> I would just like to know why I cannot display the tables in the treeview.
> This is the code:

>     SQLConnection1.LoadParamsOnConnect := False;
>      SQLConnection1.Params.Values['HostName'] := txt_host.text;
>      SQLConnection1.Params.Values['User_Name'] := txt_user.text;
>      SQLConnection1.Params.Values['Password'] := txt_pass.text;
>      SQLConnection1.Params.Values['Database'] := 'mysql';
>      SQLConnection1.Params.Values['DriverName'] := 'MYSQL';
>      ShowMessage (SQLConnection1.Params.Values['HostName']);
>      ShowMessage (SQLConnection1.Params.Values['User_Name']);
>      ShowMessage (SQLConnection1.Params.Values['Password']);
>      ShowMessage (SQLConnection1.Params.Values['Database']);
>      ShowMessage (SQLConnection1.Params.Values['DriverName']);

>      SQLConnection1.Connected := True;.  <----code crashes here

> Just ignore the whole MS Access bit this is seperate for now and is not
> relevent.

> I know that the program is connecting to mysql because (1) I connect to the
> mysql server and run a "show processlist" and I get the process in the list
> with the user name, (2) my zonealarm firewall asks me if I want to allow
> this program to access 127.0.0.1:3306. But somewhere the whole thing is
> going wrong

> This application will be running on both windows and on linux (after it it
> compiled under kylix) so any ideas here to improve functionallity will be
> welcomed.

> This content is echoed in my attatchments post
> --
> Thanks lots
> {*word*221} Ducky

Re:Problem still with my mysql dbexpress app (listing tables)


Rar files are like zip files but include authentication stuff.  You can open
it using winzip or winrar (rarsoft.com)

Quote
"Marilyn Thioux" <mthi...@inprise.com> wrote in message

news:3BC4BA5F.8B154075@inprise.com...
Quote
> Hi,

> I'm not familiar with the .rar format of your attachment.  Is this a
compression
> format for Linux?  Do you happen to have a small testcase of the problem
that I
> can look at in Delphi?

> Fyi, running your example worked for me, so there must be more going here.
I'm
> using MySQL 3.23.41.  I'm assuming that you're able to connect directly
with
> TSQLConnection (i.e. w/o code by dropping the component, setting the
options,
> LibraryName=dbexpmysql.dll, etc.)?  Also, what version of MySQL are you
using?

> Thanks,

> Marilyn

> {*word*221} Ducky wrote:

> > Is anyone willing to have a look at my project I am developing using
Delphi
> > 6?  The project has one and only one form.
> > I have posted my project to borland.public.attatchments on this news
server.
> > The post has the subject "{*word*221} Duckys' DBExpress Problem"

> > The problem I am having is this; I am simply trying to connect to a
mysql
> > server (currently localhost but can be specified) display a list of the
> > databases and tables in a treeview.<FULL STOP> (And hopefully my aim is
when
> > you select a table the immediate right hand dbgrid shows the properties
of
> > this table.  The dbgrid below it will have a select * from <selected
table>
> > and simply outputs the data for the selected table.  This is not
important)

> > I would just like to know why I cannot display the tables in the
treeview.
> > This is the code:

> >     SQLConnection1.LoadParamsOnConnect := False;
> >      SQLConnection1.Params.Values['HostName'] := txt_host.text;
> >      SQLConnection1.Params.Values['User_Name'] := txt_user.text;
> >      SQLConnection1.Params.Values['Password'] := txt_pass.text;
> >      SQLConnection1.Params.Values['Database'] := 'mysql';
> >      SQLConnection1.Params.Values['DriverName'] := 'MYSQL';
> >      ShowMessage (SQLConnection1.Params.Values['HostName']);
> >      ShowMessage (SQLConnection1.Params.Values['User_Name']);
> >      ShowMessage (SQLConnection1.Params.Values['Password']);
> >      ShowMessage (SQLConnection1.Params.Values['Database']);
> >      ShowMessage (SQLConnection1.Params.Values['DriverName']);

> >      SQLConnection1.Connected := True;.  <----code crashes here

> > Just ignore the whole MS Access bit this is seperate for now and is not
> > relevent.

> > I know that the program is connecting to mysql because (1) I connect to
the
> > mysql server and run a "show processlist" and I get the process in the
list
> > with the user name, (2) my zonealarm firewall asks me if I want to allow
> > this program to access 127.0.0.1:3306. But somewhere the whole thing is
> > going wrong

> > This application will be running on both windows and on linux (after it
it
> > compiled under kylix) so any ideas here to improve functionallity will
be
> > welcomed.

> > This content is echoed in my attatchments post
> > --
> > Thanks lots
> > {*word*221} Ducky

Other Threads