DBGrid Question

DBGrid Question

Post by James Schroed » Thu, 10 Apr 1997 04:00:00



As a faily new VB developer I have a questions for the experts out there...

I have created a database to keep track of the PCs at my work place.  I
am tracking a lot of detail about each PC as well as peripherals, cards
and motherboard information.

On my main form I want to use a DBGrid that displays all the types of
monitors available to be used.  However, I only want the one
associated with the PC (via an ID number) currently displayed to be
selected in the Grid.  This way the user can see which peripheral is
assigned to the PC, but can select another one if they are swapped out.

Thus far I have used only unbound controls, but am open to any
suggestions as how to accomplish this...If anyone can at least point me
in the right direction I would appreciate it...
thanks

 
 
 

DBGrid Question

Post by Henry La » Tue, 15 Apr 1997 04:00:00



writes

Quote:>On my main form I want to use a DBGrid that displays all the types of
>monitors available to be used.  However, I only want the one
>associated with the PC (via an ID number) currently displayed to be
>selected in the Grid.  This way the user can see which peripheral is
>assigned to the PC, but can select another one if they are swapped out.

I don't think I entirely understand what you want so if this is off beam
please let me know.  But if you have a "System" table containing all the
stuff about individual systems (make, memory size, etc), and a "Monitor"
table containing information about various types of monitor (diagonal,
refresh rate, description ...), then you can do an SQL query of the form

  SELECT SystemUser, MemorySize, MonitorDesc FROM
  System, Monitor WHERE Monitor.Id=System.Id;

And get a result which looks like this

  SystemUser     MemorySize    MonitorDesc
  ----------     ----------    -------------
  Finkle, J      32            SuperVid 17
  BigBoss, T     64            AmazingScreen 27
  Blow, Joe      32            SuperVid 17

Where the MonitorDesc's are stored in the Monitor table, and the other
stuff is in the System table.  This much you probably know.

BUT .. you can bind a DBGrid to this query so that your grid contains
the table as above.  You can probably make it updatable too, though I
haven't done that part.

Which version of VB are you using?


Manchester, England