Solved

dbGrid question!

Posted on 2004-05-01
11
478 Views
Last Modified: 2010-04-05
I want to acces the tDbGrid's data as I did in tStringGrid with the Cells[x,y] property. I have tried diferent methods but I can't seem to do it.

I used "DBGrid1.Fields[0].AsString" but I get only the first row, how to I access the other one's too?

I could be something with "GotoBookmark" but I don't know how.

Please help,
Cris.
0
Comment
Question by:xtremecris
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 7

Expert Comment

by:sftweng
ID: 10968710
The bookmark has an array prperty called "Items", containing the selected rows (and a Count of them), much like a string grid. Of course, you need to "select" the rows you want to work with.
0
 
LVL 1

Author Comment

by:xtremecris
ID: 10968890
How do I select the rows?
0
 
LVL 1

Author Comment

by:xtremecris
ID: 10968908
Please present a solution for what I want to do! By that I mean source code included.

Best regards,
Cris.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 7

Expert Comment

by:sftweng
ID: 10968998
OK, Cris, I'll try to do that but I won't be able to send code until (at least) tomorr9ow. I invite other experts to do so in the meantime.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10970365
0
 
LVL 1

Author Comment

by:xtremecris
ID: 10970581
@esoftbg: there is nothing there(We're sorry, but this page is currently unavailable for viewing), please check the link.
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 200 total points
ID: 10970695

   in DBGrid you havigate with the Dataset attached to it.

   if you want to move first/back/forward/last you use
      DBGrid1.DataSource.DataSet.First;
      DBGrid1.DataSource.DataSet.Prior;
      DBGrid1.DataSource.DataSet.Next;
      DBGrid1.DataSource.DataSet.Last;

   if you want to locate specified row use this :
   DBGrid1.DataSource.DataSet.Locate('ID', 5, [loCaseInsensitive, loPartialKey]);
   (here you want to select the row, where ID = 5 or ID starts with 5 (loPartialKey flag))
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10970707
Thanks, IvanovG. An elegant solution.
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10970710

  always welcome :)
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10973287
@xtremecris,
I have no problems to download the file Q_20974690.zip as it is declared above, but you may visit
http://www.geocities.com/eosoft/
first as a web-page and then download from the link
Q_20974690.zip
Really I don't understand what happens with my yahoo web-pages. I can access them without problems, but you are the second, who alert me for "currently unavailable for viewing" message ????
emil
0
 
LVL 1

Author Comment

by:xtremecris
ID: 10973339
@esoftbg
Your code was good and I'm thinking you worked for some time at it. I wish I could reward your effort but unfortunatly I accepted somebody else's answer.

Now I can download the file from yahoo, maybe it takes a couple of hours(from the upload) for the files to become "worldwide available". I don't really know what's going on I didn't work with yahoo for uploading.

Best regards,
Cris.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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