• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

delphi dbgridnavigation

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
abunectar
Asked:
abunectar
  • 4
  • 4
1 Solution
 
bhagyeshtCommented:
can you write to the community support to transfer this question to the delphi section under programming->languages->delphi ?
0
 
JackNaifCommented:
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
 
bhagyeshtCommented:
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
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.

 
JackNaifCommented:
You're welcome. But what does "JOA" mean?
0
 
bhagyeshtCommented:
JOA:jack of all ;-)
0
 
JackNaifCommented:
LOL

So that it is! Well... I guess I'm kinda a little bit of that too...
0
 
JackNaifCommented:
I humbly raise my hand for the points...
0
 
bhagyeshtCommented:
I second JackNaif
Bhagyesh Trivedi
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now