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

dbGrid question!

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
xtremecris
Asked:
xtremecris
  • 4
  • 3
  • 2
  • +1
1 Solution
 
sftwengCommented:
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
 
xtremecrisAuthor Commented:
How do I select the rows?
0
 
xtremecrisAuthor Commented:
Please present a solution for what I want to do! By that I mean source code included.

Best regards,
Cris.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sftwengCommented:
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
 
esoftbgCommented:
0
 
xtremecrisAuthor Commented:
@esoftbg: there is nothing there(We're sorry, but this page is currently unavailable for viewing), please check the link.
0
 
Ivanov_GCommented:

   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
 
sftwengCommented:
Thanks, IvanovG. An elegant solution.
0
 
Ivanov_GCommented:

  always welcome :)
0
 
esoftbgCommented:
@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
 
xtremecrisAuthor Commented:
@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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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