?
Solved

Small local database

Posted on 2004-04-24
14
Medium Priority
?
238 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 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