Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Small local database

Posted on 2004-04-24
14
Medium Priority
?
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

610 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