Solved

delphi dbgridnavigation

Posted on 2003-11-05
11
223 Views
Last Modified: 2013-11-13
hi iam using delphi7 with ado2.5 and access database.i am using dbgrid and able to view the data from database.But iam not able to edit the value in dbgrid and save it to database.iam not using componets to connect database.i have connected through coding to connect to database and i am using adodb.recorset for moving the record.any ony help me out to edit in dbgrid and save the data to the access database using codes.if u send me sample codes it will be more useful to me.thank u
0
Comment
Question by:abunectar
  • 4
  • 4
11 Comments
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9685436
can you write to the community support to transfer this question to the delphi section under programming->languages->delphi ?
0
 
LVL 1

Accepted Solution

by:
JackNaif earned 20 total points
ID: 9707910
Please note that Bhagyesht is right: this question will find more experts that can answer it if you move it to Programming/Delphi.

However, it found me. =)

You can try something like this:


// Num and Vers are strings holding values for the Number and Version fields of the database.
// Together, these two field form a unique key.

//Connect to the DB through ADO. Then:


{ Find the record to modify: }
FoundIt := ADODataSet.Locate('Number;Version',VarArrayOf([Num, Vers]), []);

if FoundIt then
begin
{ Put the data set into edit mode: }
   ADODataSet.Edit;

{ Change the value of the "IsDirty" field to 'false' (This is from quite an odd programme where
the DB was not actually a DB but an Excel sheet, so, this boolean value is also stored as a string, for formatting problems with Excel): }
   ADODataSet['Is Dirty']:='false';

{ Record the change in the DataBase. Without this, changes take no effect: }
   ADODataSet.Post;
end; { if }


Hope it helps:

Jack
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9712330
JackNaif: Thanks for backing me! but it often is not the case that experts like you (delphi persons) work in the programming section. usually JOA fellas like me are here ;-).
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 1

Expert Comment

by:JackNaif
ID: 9715909
You're welcome. But what does "JOA" mean?
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9719949
JOA:jack of all ;-)
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9724427
LOL

So that it is! Well... I guess I'm kinda a little bit of that too...
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 10322009
I humbly raise my hand for the points...
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10331049
I second JackNaif
Bhagyesh Trivedi
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

785 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