Solved

Small local database

Posted on 2004-04-24
14
224 Views
Last Modified: 2010-04-05
hello
i need a small small DB   a small table to add three columns , and then to compare  a strings in each columns items  and how can i delete and use for loop to compare
the strings .
0
Comment
Question by:mis82
  • 4
  • 4
  • 2
  • +2
14 Comments
 
LVL 7

Expert Comment

by:sftweng
ID: 10906672
0
 
LVL 2

Expert Comment

by:PatrickMMartin
ID: 10907343
Depending upon your Delphi version, (Pro or above ) you would be able to use TClientDataSet to read a binary (or xml) based table from a local file. In memory, you can easily perform searches, deletes updates etc. and then update the file.

If you have to use Delphi Personal, you can use ADO to create a JET mdb database (MSAccess format) and do the same things that way.

What is your version of Delphi?
0
 

Author Comment

by:mis82
ID: 10908159
Delphi 7 pro
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10909101
You might like to look at one of the Delphi demo projects, in %DELPHI%\Demos\DB\TextData. It uses a TDataSet and a TDBGrid.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10909427
http://firebird.sourceforge.net/

Firebird is a commercially independent project of C and C++ programmers, technical advisors and supporters developing and enhancing a multi-platform relational database management system based on the source code released by Inprise Corp (now known as Borland Software Corp) under the InterBase Public License v.1.0 on 25 July, 2000.
0
 
LVL 2

Expert Comment

by:PatrickMMartin
ID: 10909705
OK: the next question is: do you need a multiuser database, because it's web application or a client-server system that shares the database, or is it a single user application.
If the latter, then I would pick one of the many classes available to just link directly into the application.

Following up on the Delphi examples: there should be a demo for TClientDataSet using an XML file as the datasource under $(DELPHI)/Demo/DbCLX/MyBaseExplorer

In fact, all the other demos under the dbclx directory are equally useful, but they use the other format TClientDataSet supports, which is a binary file with a .cds extension.
If you want to use xml instead of the binary format, just add a button to save the TClientDataSet as xml - look up the method in the help. You can then load from the xml file.



0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:mis82
ID: 10912053
No i dont want a multi user database  , i need only local and small databsae
add and modify and delete and compare and save values rows and columns
something simple
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10912078
TClientDataSet:

TClientDataSet implements a database-independent dataset.

Unit

DBClient

Description

TClientDataSet represents an in-memory dataset. A client dataset can be used as

A fully-functional, stand-alone, file-based dataset for single-tiered database applications. When used in this manner, the client dataset represents the data stored in a dedicated file on the user’s hard disk.
      A local in-memory buffer of the records from another dataset. The other (source) dataset can reside in the same form or data module as the client dataset (for example, when the client dataset provides navigation and editing support for the data from a unidirectional dataset). The source dataset can also reside on a separate system when the client dataset supports the client portion of a multi-tiered database application.

Note:      The two functions described above are not mutually exclusive. An application can be designed to support the option of working with data offline, using the “briefcase” model. On site, the application uses TClientDataSet to communicate with the database server associated with a source dataset. When a user works off site, the client dataset writes a snapshot of the data to the hard disk.  The application works with this snapshot off site, with the client dataset acting as a file-based dataset in a single-tiered application.

When a client dataset represents the data from another dataset, it communicates with that dataset through a dataset provider. The client dataset communicates with this provider through the IAppServer interface. When the provider is in the same form or data module as the client dataset, the IAppServer interface is implemented by a hidden object that is created for you. When used in a client application as part of a multi-tiered application, the client dataset passes all calls to the provider through a remote data module’s IAppServer interface.

TDBGrid:

TDBGrid displays and manipulates records from a dataset in a tabular grid.

Unit

DBGrids

Description

Put a TDBGrid object on a form to display and edit the records from a database table or query. Applications can use the data grid to insert, delete, or edit data in the database, or simply to display it.

At runtime, users can use the database navigator (TDBNavigator) to move through data in the grid, and to insert, delete, and edit the data. Edits that are made in the data grid are not posted to the underlying dataset until the user moves to a different record or closes the application.

TDBGrid implements the generic behavior introduced in TCustomDBGrid. TDBGrid publishes many of the properties inherited from TCustomDBGrid, but does not introduce any new behavior.
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10912111
Can you post your database "schema", the list of fields, their lengths and types? You original question left me a little confused - do you have three numeric fields whose values are to be summed (added)?

To iterate through the data, all you have to do is create a "for" loop that goes through the rows of the TDBGrid. What do you want the string comparison to do?
0
 

Author Comment

by:mis82
ID: 10912127
username password    address
   aaa          xxxxx       192.168.0.1
   bbb          ooooo      192.168.0.2
   ccc          llllllllllll       192.168.0.3

i mean strings and maybe i will use some integer values
thats all
0
 

Author Comment

by:mis82
ID: 10957939
any help?
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13302454
PAQed with points refunded (250)

modulo
Community Support Moderator
0

Featured Post

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

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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