Solved

simple database

Posted on 1997-09-28
10
207 Views
Last Modified: 2013-12-26
I am using Borland C++ 4.5

Please could someone provide me with a simple database example using a dialog box with edit boxes (not a combo box).This example should be able to read in two or three records to file and then be able to read them out again and display then one at a time in the dialog box.

many thanks

Richard
0
Comment
Question by:aa941438
  • 5
  • 5
10 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1299406
What kind of database are you using or can you define your own database format? Do you have the 4.5 with the database tools?
Do you mean that you want an example where you can create a record with a few field (via entering data in the editboxes) and then navigate through them via some buttons (next, previous,...)?

0
 

Author Comment

by:aa941438
ID: 1299407
Yes, I have just installed Borland C++ 4.5 with database tools. However, I'm damned if I can find the tools!!!!!!!!! Can you point me in the right direction to where they are.

To elaborate, while I have created a few simple databases in the past this will be my first with a visual front end. My principle problem is that I don't know how to enter a series of records through the front end and read them back again. As such, I would like an example which I could work from.

Your description sounds about right. I would like an example where you can create a record by entering data into a few fields i.e.,via entering data into edit boxes (not combo), and then be able to navigate through the entered records as desired via some buttons(next, previous,...).

regards

Richard
0
 
LVL 3

Expert Comment

by:msmits
ID: 1299408
I have currently 5.02 installed, which has all the database tools integrated. They are controls in the resource workshop. I have an example plus description of how to make such an application, but only for 5.0.
I can try to install 4.5 tonight and try to recreate and check my approach on that. The code is however to large to post here. I can make it available on my ftp site.
0
 

Author Comment

by:aa941438
ID: 1299409
Thanks for your efforts. It's most appreciated.

If your code can provide me with the information I require with respect to reading and writing records I would be very grateful if I could down-load it from your ftp site.

regards

Richard


0
 
LVL 3

Expert Comment

by:msmits
ID: 1299410
The 5.0 has droppable database controls in the resource workshop. This functionality is not in the database tools. The database tools in 4.5 is the API and tools for accessing the BDE.

Are you using some kind of existing database or must the application create the database itself? What type of database is used by the application (Access, Paradox or other) or doesn't it make any difference?

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:aa941438
ID: 1299411
Thanks for you message and efforts.

No I am not using an existing database. The database must be created by the application itself even though what I require is  relatively simple.

I have been exploring the possibility of installing version 5.0 on my machine but this looks rather unlikely as my machine is not currently up to the task and I don't hold out much hope in this area. I'd rather not buy a new machine if I can help it!

what do you think?

regards

Richard
0
 
LVL 3

Expert Comment

by:msmits
ID: 1299412
You need to use the BDE API functions to accomplish the task when using Borland 4.5. The BDE, its API and tools are the extra database stuff that is called 'Database Tools'.
Programming with the BDE API is not simple. The helpfile (in the doc directory of the BDE installation) provides the necessary information for programming with that API.

I have created an example application which is a dialog client with a menu. The only relevant menu action is creating the empty database.
All other elements are in the dialog. It contains two editboxes and a whole bunch of buttons for all the separate actions. The BNClicked functions for this buttons perform the necessary BDE database actions.

The basic sequence is:

  DbiInit();
  DbiOpenDatabase();
  DbiSetDirectory();
  DbiOpenTable();
  DbiGetCurProps();
   malloc for record buffer
  DbiSetToBegin();
  DbiGetNextRecord();               (n times)

  DbiCloseCursor();
  DbiCloseDatabase();
  DbiExit();

The sample application can be downloaded from the following URL:

  ftp://ftp.IAEhv.nl/pub/users/msmits/exp-exch/sdbase.zip

You need to open the sdbase.ide file with Borland C++, generate the .apx file for the ClassExpert and maybe change some paths for the include files and libraries.
Just in case the .ide file of 5.0 doesn't work, I also included the makefile sdbase.mak.

0
 

Author Comment

by:aa941438
ID: 1299413
Thanks for help, really appreciated. However, I cannot access your ftp site.

I've tried 'open IAEhv.nl' but I am requested for a name and password which I don't know.

All other combinations of the ftp address given result in 'unknown host' being flaged.

Maybe I'm missing something but it would appear I need a guest name and password. What do you think?

regards

Richard


0
 
LVL 3

Accepted Solution

by:
msmits earned 550 total points
ID: 1299414
You need to do anonymous ftp to ftp.IAEhv.nl. Which means that you can use 'ftp' (without the quotes) as username and your email address as password.
Then you can cd to the /pub/users/msmits/exp-exch directory and do a binary get of sdbase.zip.

You can also copy the full url from my previous answer and paste it in the URL or location box of Netscape or IExploder. This will do the anonymous ftp for you.

0
 

Author Comment

by:aa941438
ID: 1299415
Many thanks, I really appreciate the time and trouble you've been to. I shall now get the program to run. Even if I can't I will have got a good insight into the requirements to code a database.

many thanks again

regards

Richard
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Clean URL from GET variables 2 93
Problem to run file 9 104
cookies analysis tools 2 72
Questions about this React unit test 4 46
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

18 Experts available now in Live!

Get 1:1 Help Now