Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12

    trying 2 find BCB Tutorials


    Hey!

    Can anyone direct me to a good online site for tutorials in Borland C++ Builder. Ideally, i need to know how to use it for accessing a MySQL Database.

    I cannot find any resources for this... even the manual is not very helpful.

    Also, the name of any decent books would be good.

    Thanks in Advance!
    -----------------------------------------------------------
    4dr14n
  2. #2
  3. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    In the way of tutorials or walkthroughs, I wasn't able to find anything good in several weeks of looking. There just isn't that much out there on the topic. Borland's site has a few tips, and I beleive they have message boards, but again, those are primarily for professional developers. I recently bought C++ builder 6 developers guide. It is fairly handy, but it goes into depth on things that I really don't care to learn. It does have quite a bit on database programming though, so It may be useful to you. I beleive it was 30 some dollars on Amazon. There are a couple newbie books (BCB for dummies) but these are based on older versions (i. e. 3 or 4). They still might be helpful, but there have been quite a few changes since these versions as compared with 6. I found builder's help file to be fairly useful with begining to learn the VCL, an generally getting used to the IDE. Good luck.
  4. #3
  5. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    Thanx for the info!

    I been trying for hours to find ANYTHING on it at all but all i could find was small abstract snippets of info.

    Nevermind...i'm gonna try it myself but i aint got much experience yet in OOP. This should b fun!

    Thanks for trying!
    -----------------------------------------------------------
    4dr14n
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    NC, USA
    Posts
    364
    Rep Power
    13
    If you want to connect to a MySQL database then you probably need to go to MySQL's site for the API for doing such things. I know they have a C API and I would imagine they have a C++ one.

    EDIT:
    Go here -> http://www.mysql.com/doc/en/Borland_C++.html
  8. #5
  9. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    Thanks...

    Got a new problem tho.

    I have set-up a link to the database (i think). the problem now is that BCB cannot open libmysql.dll. I have specified in the project options the path to this dll but it still gives me the error.

    I need suggestions on how to stop this error appearing!

    All help appreciated

    PS> I am new to this area of programming so if u need moreinfo let me know.
    -----------------------------------------------------------
    4dr14n
  10. #6
  11. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    The book Delphi/Kylix Database Development has a lot of information about using Borland technology to access a database. Even though the code examples are in Delphi, since they're using the same connectivity tools as C++ Builder it helps you understand how your program should flow and the different features that are available. I bought mine off of eBay for ~$15.

    See the .pdf file attached to this post and see if it helps.

    As far as your .dll problem goes, BCPPB does not need this .dll in order to compile. The resulting .exe needs it in order to run. So setting the path in your project does not help. You need to set the path at the operating system level. In other words go to Start->Settings->Control Panel->System and add the location of the .dll to your path. Or just move the .dll into the current path (like your system32 directory). See if that helps any and let us know.
    Attached Files
  12. #7
  13. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    Thanks for taking the time to reply.

    I had just moved the .dll into the system32 path as you sent that message but it still doesn't work!

    As for the pdf... thanks for sending it but that is actually the tutorial i am working from and cant get to work!!! It uses the interbase examlpe but i am trying to apadt this to get it to work for mysql...this is where the errors are coming from!

    I am wondering whether this would be easier to do using an odbc connection...

    anyway, thanks for the reply and suggestions...much appreciated!
    -----------------------------------------------------------
    4dr14n
  14. #8
  15. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Just out of curiousity, which version of C++ Builder are you using (Standard, Pro, Enterprise)? I know that all of them don't have the same database features so I don't want to give you advice you can't use.
  16. #9
  17. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Also, I pulled up C++ Builder on my machine and started to drag some components onto my form to see if I could connect to MySQL. The controls I dragged onto the form wanted to connect to MySQL in order to populate comboboxes with lists of tables. So I got your "libmysql.dll" error as well.

    I went to Project->Add to Project->Any Files and selected libmysql.dll. This helped a lot. BCB may not need the .dll to compile, but it does need it to design.:rolleyes:

    I do all my database programming via the API so some of this control-based programming I'm a little rusty on....
  18. #10
  19. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    Using version 6 Pro on a windows NT box.

    I am now reading up about using an odbc connection coz it seems easier to use. I can access MySQL databases through MSAccess using the ODBC method so i am hoping to be able to do something similar now.
    -----------------------------------------------------------
    4dr14n
  20. #11
  21. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    To get my dbExpress connection to work properly I had to set the fully qualified path of C:\mysql\bin\libmysql.dll in the VendorLib property of the Connection control. As soon as I did that, Iwas able to get MySQL data to pop up in a grid without a single line of code.

    All I had was a connection, clientdataset, datasource and a grid.
  22. #12
  23. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    You are doing better than me...my grid just stays empty!

    i put in the full pathname as you suggested but i still get the same error message...

    "unable to load c:\mysql\bin\libmysql.dll"

    This is so frustrating!!

    Have you edited anything in project manager or anywhere else that i might not have done?

    Thanx 4 taking the time to do this!

    nb...regardless of what i put in the vendorlib property it still comes up with unable to load!
    Last edited by 4dr14n; June 19th, 2003 at 10:23 AM.
    -----------------------------------------------------------
    4dr14n
  24. #13
  25. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    WOOOOOOOOOOOOO!!!!!

    I just changed method and managed to connect to the database in minutes using ADO.

    dcaillouet > Thanx for the assistance, it was much needed!!
  26. #14
  27. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    lol, that's one guy who will be coming back to devshed for problems.
  28. #15
  29. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Originally posted by 4dr14n
    i put in the full pathname as you suggested but i still get the same error message...

    "unable to load c:\mysql\bin\libmysql.dll"

    This is so frustrating!!
    I can pull up a completely empty project, drop a connection on the form, set the DriverName to MySQL , VendorLib to "C:\mysql\bin\libmysql.dll" the database parameters under Params and get a working connection.

    The only way I can get your error message is if I mistype the path to libmysql.dll. I know this may be a stupid question but in an earlier post you said you moved the .dll to the system32 directory. Are you sure your path is correct? Should it actually be something like "C:\Winnt\system32\libmysql.dll"?

    Having used ADO with MySQL before I just need to warn you that occassionally you can get some weird errors. For example ADO doesn't like MySQL dates set to "0000-00-00 00:00:00". The ODBC driver's optimizing of column width's can cause hard to diagnose problems as well.

    If you're just going to be using MySQL and don't plan to port your program, accessing the mysql .dll directly instead of through ADO might be better if you can get it to work.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo