Solved

simple database

Posted on 1997-09-28
10
206 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:aa941438
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

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

11 Experts available now in Live!

Get 1:1 Help Now