Solved

dbGrid question!

Posted on 2004-05-01
11
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

738 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