Solved

delphi dbgridnavigation

Posted on 2003-11-05
11
221 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
 
LVL 1

Expert Comment

by:JackNaif
ID: 9715909
You're welcome. But what does "JOA" mean?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 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

13 Experts available now in Live!

Get 1:1 Help Now