Solved

dbGrid question!

Posted on 2004-05-01
11
475 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

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

16 Experts available now in Live!

Get 1:1 Help Now