🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.dbexpress
6 messages
6 total messages Started by Aaron Thu, 12 Aug 2004 18:28
CBuilder 6 using DBExpress to connect to Mysql
#87
Author: Aaron
Date: Thu, 12 Aug 2004 18:28
36 lines
2031 bytes
I am trying to use mysql db in a Cbuilder 6 app.  from what I have read I
should use DBExpress.
So I did the following.
Created a SQLConnection with the following properties
Connected - false
ConnectionName - MSConnection
DriverName - MYSQL
GetDriverFunction - getSQLDriverMYSQL
Keep Connection - true
LibraryName - dbexpmys.dll
LoadParamsonConnect - false
LoginPrompt - true
Name - SQLConnection1
Params - none
VendorLib - LIBMYSQL.dll

then i created a TSQLTable object with the following properties
Name - SQLTable1
NoMetaData - false
ObjectView - false
SQLConnection - SQLConnection1   --->pointing to the SQLCONNECTION object I
jsut created above
tableName - C:\mysql\data\test\appusernames.frm



when I try to set the table to active I get a password prompt.  no matter
what I put in here I get an error message "DBX Error: Invalid
Username/Password"
since this is the test database it shouldnt even need a password.  so I set
the loginprompt field to FALSE and I still get the error message.

Does anyone know what I am doing wrong?  if not, does anyone have CBuilder6
working with mysql and if so, how did you set it up???

HELP!
Re: CBuilder 6 using DBExpress to connect to Mysql
#88
Author: Lotfi
Date: Thu, 12 Aug 2004 20:20
40 lines
1733 bytes
Hi

I am trying to set the same things (mySQL+dbexpress)

the username and more info must be provided in a (TString struc ion the
Params property of your SQLConnexion

someting like

DriverName=MYSQL
BlobSize=-1
Database=\test
ErrorResourceFile=
HostName=c:\Apache2\mysql\data\mysql
LocaleCode=0000
Password=
User_Name=root

(or :)
DriverName=MYSQL
BlobSize=-1
Database=test
ErrorResourceFile=
HostName=localhost
LocaleCode=0000
Password=
User_Name=root

but I didn't succeeded in connecting (see my post just befor yours)
in fact, in my case it didn't load the libmysql.dll

what version of MySQL do you use ?
somebody said on a forum that it works for mySQL 3.xx but not with 4 ???
I need confirmation or infirmation, and what can we do to make it work with
MySQL 4 ?

if u got something new, please let me know

Ciao
Re: CBuilder 6 using DBExpress to connect to Mysql
#89
Author: Aaron
Date: Thu, 12 Aug 2004 21:01
61 lines
2693 bytes
i am using the mysql 3.23 driver.  it wont work with v4
so I use the v3 driver and get rid of the cant find dll error.  but now I
cant connect because of the password error.
the problem is that I dont even know if i am looking in the right spot or
what because it is confusing
that I should need a password for a db that doesnt have a password.(test
db).  even username = root doenst work.

you would think that someone out there has made this work.  there is no
documentation or examples from borland or on the mysql site.  and I googled
the same problem and there are other people with the same problem but nobody
has yet to provide a solution.



"Lotfi" <llbaghli(nospam)@ifrance.com> wrote in message
news:411bd06b@newsgroups.borland.com...
>
> Hi
>
> I am trying to set the same things (mySQL+dbexpress)
>
> the username and more info must be provided in a (TString struc ion the
> Params property of your SQLConnexion
>
> someting like
>
> DriverName=MYSQL
> BlobSize=-1
> Database=\test
> ErrorResourceFile=
> HostName=c:\Apache2\mysql\data\mysql
> LocaleCode=0000
> Password=
> User_Name=root
>
> (or :)
> DriverName=MYSQL
> BlobSize=-1
> Database=test
> ErrorResourceFile=
> HostName=localhost
> LocaleCode=0000
> Password=
> User_Name=root
>
> but I didn't succeeded in connecting (see my post just befor yours)
> in fact, in my case it didn't load the libmysql.dll
>
> what version of MySQL do you use ?
> somebody said on a forum that it works for mySQL 3.xx but not with 4 ???
> I need confirmation or infirmation, and what can we do to make it work
with
> MySQL 4 ?
>
> if u got something new, please let me know
>
> Ciao
>
>
>
Re: CBuilder 6 using DBExpress to connect to Mysql
#90
Author: Lotfi
Date: Fri, 13 Aug 2004 00:02
42 lines
2378 bytes
"Aaron" <mryamz@comcast.net> a �crit dans le message news:
411bdabd$1@newsgroups.borland.com...
> i am using the mysql 3.23 driver.

can u use 3.23 driver with MySQL 4 installed ???

>  it wont work with v4
> so I use the v3 driver and get rid of the cant find dll error.

are u sure it is impossible   with 4 ???

> but now I cant connect because of the password error.
> the problem is that I dont even know if i am looking in the right spot or
> what because it is confusing
> that I should need a password for a db that doesnt have a password.(test
> db).  even username = root doenst work.
>
> you would think that someone out there has made this work.  there is no
> documentation or examples from borland or on the mysql site.  and I
googled
> the same problem and there are other people with the same problem but
nobody
> has yet to provide a solution.
>

you just leave password without anything

here are all the links I have (sorry in french ;-(
http://www.developpez.com/hcesbronlavau/dbExpressDelphi6.htm
http://jmcarayon.developpez.com/dbexpress/

other components :
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=20972
http://crlab.com/mydac/download.html
http://www.zeoslib.net/modules.php?name=Downloads&d_op=search&query=mysql
http://www.scibit.com/products/mysqlcomponents/
directly with the API
http://lfe.developpez.com/BCBmySQL/

hope it helps
ciao
Re: CBuilder 6 using DBExpress to connect to Mysql
#91
Author: Lotfi
Date: Fri, 13 Aug 2004 22:39
23 lines
1609 bytes
"Aaron" <mryamz@comcast.net> a �crit dans le message news:
411bdabd$1@newsgroups.borland.com...
> i am using the mysql 3.23 driver.  it wont work with v4

Hi again

I tried to "contourner" the Pb...
So I copied libmysql.dll version 3.23 in the WinNT system32 dir while still
using MySQL 4.0.20

So, now I can connect to db (login root, pw (nothing), localhost) As I
already mention
but, the OPEN MySQL gives "violation access" and stop the appli
(for sure it is incompability of what is used and what is run on the ersver)

But this mean that :
vers 3.23 can connect
vers 4 doesn't even connect !!! to dB :-(

and you what's new ?

ciao
dbexpress+mySQL4, IT WORKS !
#92
Author: Lotfi
Date: Mon, 16 Aug 2004 02:08
232 lines
6011 bytes
So dbexpress + mySQL 4 :-)
need some configuration of  :

dbxdrivers.ini (for default config)

add these :

[Installed Drivers]
MySQLCon=1
[MySQLCon]
GetDriverFunc=getSQLDriverMYSQL
LibraryName=dbexpmysql.dll
VendorLib=libmysql.dll
BlobSize=-1
Database=test
ErrorResourceFile=
HostName=localhost
LocaleCode=0000
Password=
User_Name=root


and to dbxconnections.ini add :

[MySQLamoi]
DriverName=MySQLCon
BlobSize=-1
Database=test
ErrorResourceFile=
HostName=localhost
LocaleCode=0000
Password=
User_Name=root


so in the the project :
mydbexprForm.h
file://---------------------------------------------------------------------
------

#ifndef mydbexprFormH
#define mydbexprFormH
file://---------------------------------------------------------------------
------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <DBXpress.hpp>
#include <SqlExpr.hpp>
#include <DBCtrls.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <FMTBcd.hpp>
#include <Grids.hpp>
#include <DBClient.hpp>
#include <Provider.hpp>
file://---------------------------------------------------------------------
------
class TForm1 : public TForm
{
__published: // Composants g�r�s par l'EDI
  TSQLConnection *SQLConnection1;
  TDataSource *DataSource1;
  TDBGrid *DBGrid1;
  TDBNavigator *DBNavigator1;
  TButton *ButtonOpen;
  TDataSetProvider *DataSetProvider1;
  TClientDataSet *ClientDataSet1;
  TSQLTable *SQLTable1;
  TButton *Button1;
  void __fastcall ButtonOpenClick(TObject *Sender);
  void __fastcall Button1Click(TObject *Sender);
private: // D�clarations de l'utilisateur
public:  // D�clarations de l'utilisateur
  __fastcall TForm1(TComponent* Owner);
};
file://---------------------------------------------------------------------
------
extern PACKAGE TForm1 *Form1;




mydbexprForm.cpp

file://---------------------------------------------------------------------
------

#include <vcl.h>
#pragma hdrstop

#include "mydbexprForm.h"
file://---------------------------------------------------------------------
------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
file://---------------------------------------------------------------------
------
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
}
file://---------------------------------------------------------------------
------
void __fastcall TForm1::ButtonOpenClick(TObject *Sender)
{
  ClientDataSet1->Close();
  ClientDataSet1->Open();
}



mydbexprForm.dfm (in text mode)
object Form1: TForm1
  Left = 391
  Top = 228
  Width = 525
  Height = 355
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object DBGrid1: TDBGrid
    Left = 0
    Top = 144
    Width = 361
    Height = 185
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
  end
  object DBNavigator1: TDBNavigator
    Left = 0
    Top = 120
    Width = 240
    Height = 25
    DataSource = DataSource1
    TabOrder = 1
  end
  object ButtonOpen: TButton
    Left = 192
    Top = 40
    Width = 75
    Height = 25
    Caption = 'Open '
    TabOrder = 2
    OnClick = ButtonOpenClick
  end
  object Button1: TButton
    Left = 304
    Top = 40
    Width = 75
    Height = 25
    Caption = 'OpenSQL'
    TabOrder = 3
    OnClick = Button1Click
  end
  object SQLConnection1: TSQLConnection
    Connected = True
    ConnectionName = 'MySQLamoi'
    DriverName = 'MySQLCon'
    GetDriverFunc = 'getSQLDriverMYSQL'
    LibraryName = 'dbexpmysql.dll'
    LoginPrompt = False
    Params.Strings = (
      'DriverName=MySQLCon'
      'BlobSize=-1'
      'Database=test'
      'ErrorResourceFile='
      'HostName=localhost'
      'LocaleCode=0000'
      'Password='
      'User_Name=root')
    VendorLib = 'libmysql.dll'
    Left = 24
    Top = 24
  end
  object DataSource1: TDataSource
    DataSet = ClientDataSet1
    Left = 144
    Top = 24
  end
  object DataSetProvider1: TDataSetProvider
    DataSet = SQLTable1
    Constraints = True
    Left = 64
    Top = 64
  end
  object ClientDataSet1: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'DataSetProvider1'
    Left = 96
    Top = 64
  end
  object SQLTable1: TSQLTable
    SQLConnection = SQLConnection1
    IndexFieldNames = 'id'
    TableName = 'ex_1'
    Left = 64
    Top = 24
  end
end



my SQL db "test" has a table "ex_1"
see my website :
for an example with Zeos objects and the database I use :
http://www.baghli.com/bcb_mysql.html



if you don't have the right dlls :
dbexpmysql.dll
and libmysql.dll
I can send them to you by email

Ciao, hope this will help you
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads