Solved

delphi dbgridnavigation

Posted on 2003-11-05
11
224 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
control image tags in a string ? 12 141
ejb wildfly example 2 19
storing csv file in table variable in Python 2 23
troubleshoot a python script 8 17
This is an explanation of a simple data model to help parse a JSON feed
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

809 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