Solved

Database no BDE

Posted on 2001-07-12
28
744 Views
Last Modified: 2013-11-23
I'm always creating database uses BDE, which as I get informed from many sources it is obsolete and can cause field error on multi user access of thousands records activity.

And so I've heard that uses ADO or DAO is the best database today (or is it?) anyway Please tell me that database way I need to re-Learn and please give me a sample code of how to create the database, field, append record, read a field in a record and change it, search for specific value of field within database, use LookUp component, master detail related dataset, delete a record, walking around the database record like first, prior, next, last, BOF, EOF, etc. And many other things which experts like to teach :) thanks alot
0
Comment
Question by:comicboy
  • 12
  • 11
  • 2
  • +3
28 Comments
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
listening ... near not answerable
0
 
LVL 21

Expert Comment

by:ziolko
Comment Utility
No matter if You use ADO or BDE modyfying and creating DB is same. Difference between BDE and ADO is the way You connect to DB, in fact ADO is much more easier to configure than BDE, with Delphi it's really piece of cake drop down on form ADOConnection component click on ConnectionString property and set Youre connection.
If You want to teach how to  configure ConnectionSettings first right click on Your Desktop you will see MicrosoftDataLink click it. File with extension UDL will apear double-click it and You will be able to easily set and test connection.
ziolko.
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello

  if you are developing client/server application and can upgrade to delphi 6, you can use the new tech from borland DB Express, but if you have delphi 5, and your application based on local database and client/server, ADO will be better for you

  if you want to know a good begining to learn ado see this link, for free DB course about ADO

http://delphi.about.com/library/weekly/aa010101a.htm

Best regards
Mohammed Nasman
0
 
LVL 5

Expert Comment

by:TheNeil
Comment Utility
As had already been said, ADO offers exactly the same command set as if you were connecting via the BDE. The only difference is in the connection itself (once that's in place then you're away as everything else behaves the same).

All you need to do is drop an TADOConnection component onto your form and set the connectionstring property. Open up the connection string builder (just double click in the obeject inspector), select the Build button. This should should bring up the Data Link Properties dialog which is where you build your connection. Select the database type that you're connecting to (Note: Use Microsoft Jet for connecting to Access) and hit the Next button. At this stage it depends on what type of database you're connecting to and how you go about this similarly depends on the database type. For something simple like Access you just need to enter the path and filename of the MDB file. When you're through setting these properties, hit the Test Connection button (to test the connection surprisingly) and if it worked then you're all ready to go. Close the dialog and get back to Delphi.

There are a couple of properties that can drive you mad if you forget about them so keep an eye on things like LoginPrompt and Active (Active just connects you but it can be done at runtime via code and is the way to do it if you dynamically create your connection string). Unlike in the BDE you're no longer tied to aliases and you can change your database connection at runtime and easily trasnfer the code from machine to another (without the need to install the BDE and setup everything). If you look at the connection string then you should see that it contains the path to your database. Just change this, reactivate the connection and you're now connected to the newly selected database

The Neil =:)
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
I made test before, but I did it in fly, to test which are faster with oracle database, BDE or ADO, I found the ADO faster than the BDE in significant diffrenace, the Borland will not support the BDE for long time, it include it in the delphi 6 for local database, but replace it with DB Express
look at this link to see the new feature
http://www.borland.com/delphi/del6/featurematrix/database.html

Mohammed
0
 

Expert Comment

by:revdmv
Comment Utility
One other thought. Your users must have the current MDAC drivers for your ADO application to work correctly. I've noticed the Install Shield works great deploying a BDE based app, but cannot easily deploy all the nessasary MDAC drivers for an ADO app. This must be done with the MS ADO install. Not a huge deal, just somthing to be aware of.
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
revdmv,
I don't think the BDE applications easier to deploy than ADO applications
mdac come already in win2000 and win me, so you will not have much problmes in these enviroment, and if you have older windows, just install mdac driver for one time, and all ur applicaiton will work fine, without any need to BDE drivers or alias
0
 

Author Comment

by:comicboy
Comment Utility
How to create the table ? in BDE I simply use Database Desktop and add my own databases in BDE Administrator. Please tell me step by step on creating a table add it to the administrator or anything with ADO.

Anyway should I better use ADO or DB Express ???

since I need this topic I raise the point :) thanks
0
 
LVL 21

Expert Comment

by:ziolko
Comment Utility
comicboy > like "we" said before ADO is the way You connect to Database, You DO NOT administer DB. For example if You use MSSQL to create database You must run Enterprise Manager to create database for Oracle or Interbase are different tools that comes with those DB systems. Of course You can use SQL to administer Your DB ( create table , drop table, etc.). With Database Desktop You can create Paradox/DBase databases and You still can use this tool to create such databases, but forget BDE Administrator. One of many reasons why ADO is much better than BDE is that You don't need BDE Administrator. When useing ADO there are no aliases, with ADO You connect directly to Database
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
comicboy
  do you have delphi 5 or delphi 6, dbexpress came only with delphi 6, and for delphi 5 use ADO

 for creating table you can still do that with database desktop but you don't requre the adminstrator db, as ziolko told you,

  you can also use JEDI Database Desktop instead of borland database desktop, it extends the last one and it's free

http://jedidbd.sourceforge.net/

Mohammed
0
 

Author Comment

by:comicboy
Comment Utility
Thanks all experts :) I'll try what you're all said :) and I'm going to download jedi database desktop, create database there and place ADO component to connect to my database ?

I'm using Delphi 5 & Delphi 6 both installed on my system
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
comicboy

  if you want to develop client/server database like (Oracle,MS-SQl,MySQL, and more) you can use DBExpress in delphi6, buf if you want to use local database (accesss, paradox) ADO will be better

Mohammed
0
 

Author Comment

by:comicboy
Comment Utility
mnasman I'm going to develop client server :) and will use DBExpress like your suggestion then :) so what should I do first ?

What I like to do is create a list of bio data of my friends in my class. Each has ID, name, address, provice and a picture of them while province is another database which has ID and provice name so I can easily use it as lookupcombobox. And I want to have search facility by province so the list show me only this provice.

What should I do first ? in BDE I will create the Table uses Database Desktop then create the form to input and place TTable and TDataSet and the navigation. And it's ready to go...

I increase points since this topic is very interresting for me :)
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello comicboy

  First you have to choose your database, if you would like to use the DBExpress, you can't use the local database like (Access, Paradox), you have to use clinet/server (Oracle,InterBase,MySql,..)
 
 look at the DBExpress tab in delphi, and use these componentes

  TSQLConnection instead of TdataBase
  TSQLDataset instead of TDataset
  TSQLTable insead of TTable
  TSQLQuery instead of TQuery

try the sqlbroswer for delphi 5
http://www.qualtech.com.br/sqlbrowser/

look alos at this article
Analysing DataSets
http://www.drbob42.com/Delphi5/examin17.htm


Mohammed
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:comicboy
Comment Utility
mnasman,

I'm very beginner on database, please tell me what should I do step by step.

If I choose Oracle then should I buy Oracle first? if I want just use windows ODBC driver can it be done ? since I want to deploy my program at my school computer so I need to select database method which doesn't require me to install anything like BDE engine etc. My school computer uses win95 or win98.

If I use MySQL what should I do ? please tell me how to create a table and all of it's fields, how to append new record and fill it's field then post it ?

I hope all other experts comment that if I use other than BDE I don't need to care about database aliases and everything just find like ussual using Delphi database components, will really true on my project which take me less headache then. Thanks all experts, I'll increase the points again :)

0
 

Author Comment

by:comicboy
Comment Utility
mnasman, as I browse SQLBrowser link, I found that it's for linux, sorry if I'm wrong, but I haven't found for windows yet.
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello comicboy

  mmmmmm, I think it's better for you to use the ADO to connect to access database, so you can easily build ur tables in access and then connect the tables to ur project in delphi, ADO doesn't require BDE or alias, but for old windows version you need to install MDAC for windows for one time.

  Yes you need to have oracle if you want to use oracle db, you need to have oracle in the server and oracle client in each machine will run ur program, about MySQl, I'm really haven't used it before, also you can try interbase, with delphi there are some component to connect directly to interbase database and it will not need BDE, so as I told you before, you need first to decide which database you have and you want to use

Mohamemd
0
 

Author Comment

by:comicboy
Comment Utility
I want to use database which almost instantly can be used on any computer running windows (maybe ADO) then if I use ADO I must create the table in ACCESS well for you to know I don't know how to create table in access and I never open any access before (but I'll try this one since it's out of topic though). And if I want to use ADO and install MDAC, what is MDAC ??? I never heard that, it's somekind of Microsoft Database Access Control or what (guessing :p) ? How can I get this MDAC ? buy it ? or from Visual C++ disc ( I have VC++ but never use it for database programming ) ?

For my quriousity what is MySQL anyway ? isn't it uses ODBC which suppose to support SQL ? or what ?

About Interbase this is also interresting since it's actually already there from older delphies and I'm never use it and even I ever thought that Interbase and BDE is the same which require me to install Interbase even I just use BDE (this is stupid I know).

Now I'm my self can't decide which database is better for me because I'm blind on database thingy outside of that old BDE. And I guess you direct me to use ADO, and I will try it to create an access table first, after that what should I do ?
0
 

Author Comment

by:comicboy
Comment Utility
anyway experts here do you use ICQ ? please contact me via ICQ since I like to chat with you in ICQ realtime rather than via this way (it's too long to just achieve an answer) and in the end I will summarize the answer post it here and give the point, isn't it better ?

Mine is : 5912421
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello

 for MDAC (Microsoft Data Access Components)
http://www.microsoft.com/data/download_260rtm.htm

 and about Ms-Access, it's very easy, you can simply create ur tables in access and then save them as MS Access Database (*.mdb), it's one file and contian all the tables

 after you create ur database file, let's say it's name "Test.mdb"
 
 Start New project in Delphi, go to ADO section, Add one ADOConnection and ADOTable
change the ADOConnection properties as following :
Click on ConnectionString from object inspector, then press build, you will see new window tabs, in the provider section choose : Microsoft Jet 4.0 OLE DB provider (it's for access 2000 files, if you have access 97 choose jet 3.51) then press next
in the connection tab select ur database file name(Test.MDB), and click on test connection button, if ur steps right it will give u message( test connection successed), then Press ok, and Ok again to close the first window

Now change the properties for the ADOTable1 as following
Connection = ADOConnection1 (the connection we made now)
TableName = choose ur table
if it inform you for password just press ok and leave it blank, if you don't want to see this message, change the login prompt for the adoconnection to false

Change the Active property for ADoTable1 to true, now you have connection and Table connectted to ur database, now add datasource and complete ur work as you was doing with BDE and datacontrol

  This way I explain for MS - Access, but if you would like to connecto to oracle or MS Sql Server, you only need just to change the OLD DB provider for the correct Driver

 I wish that's be clear for you
 
 if you have still problems, email me at nasman@mogaza.org, and I will send you sample project with ado

Best regards
Mohammed Nasman

0
 

Author Comment

by:comicboy
Comment Utility
wow this is the one I want :) please wait I'll test it
0
 

Author Comment

by:comicboy
Comment Utility
M nasman please wait, I don't have time yet to test, this message just to make you know that I'm still doing things on this question, thanks please be patience since this I'm still learning database from scratch...
0
 

Author Comment

by:comicboy
Comment Utility
MNasman, please wait, now as you may see in EE I'm still have a BDE assignment, I'm going to take care this new assignment later, please be patience :) thanks alot, not because I don't want to give the point just I don't want to lost topic on this... by asking new question from ground up
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
:o)
0
 
LVL 22

Accepted Solution

by:
mnasman earned 200 total points
Comment Utility
comicboy, what's happened to the assignment ;o)
0
 

Author Comment

by:comicboy
Comment Utility
Hi, I'm so sorry mnasman, I think it will took alot longer than I thought on this assignment, and so rather than drag you to wait with me, better I give the points :) anyway thanks alot for your patience and helpfull guidance, you're always the best :) thanks
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Thanks for ur poinsts comicboy, I hope you the best with the assignment :o)
0
 

Author Comment

by:comicboy
Comment Utility
Anyway please help me if I need another guidance, I'll post question related to this question for expert like you thanks :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now