Strange Error using a DBGrid

Strange Error using a DBGrid

Post by Marc Charro » Thu, 16 Jan 1997 04:00:00



Hi everyone.  I hope someone can help me with this small (I think)
problem I have.

It's happened in 3 or 4 different applications I've built.  When I use a
DBGrid on a TPageControl, and it's not on the tab that first appears
when you start the program, I get this error:

Grid Index out of range.

If the first thing I do is choose that tab, the program runs OK, but if
I do processing that uses the table defined in the grid, I get the
error.  When I make that tab the first tab that show up when I start the
program, everything is fine.

I suspect it must be something I overlooked, but for the life of me, I
can't find out what it is.  Any and all help is appreciated.

Marc

 
 
 

Strange Error using a DBGrid

Post by Mark Smi » Sat, 18 Jan 1997 04:00:00



>Grid Index out of range.
>If the first thing I do is choose that tab, the program runs OK, but if
>I do processing that uses the table defined in the grid, I get the
>error.  When I make that tab the first tab that show up when I start the
>program, everything is fine.

Whenever you do some processing on the table, the dbgrid gets an event
which causes it to repaint itself. Whenever it is not visible, like in
your case, you will get this error. You can work around this by
setting the datasource-property of the dbgrid to nil and set it to the
table when the tab is activated and reset it to nil when leaving the
tab.

 
 
 

1. Help using DBGrid and set up DBGrid Display

Can anyone give some guidance:
I am using VB 5.0.
I have a DBGrid control bound to a Data control (it is a querry) that has
15-20 fields in it.  I am only using three (3) fields in the DBGrid.  The
first two I don't want to allow any manipulation of.  The third field I want
the user to beable to change.  I used the Page Edit function to give the
individual columns lock and unlock properties (the first two were locked and
the third unlocked).

Unfortunately I can't change any data in the third column (nor the first two
either).  My data control properties are of the data control are:
Exclusive = False
Read Only = False
RecordSet = Dynaset

Second part of the problem is that I want to display only one set of the
querry based on a selection from the one-to-many set (querry) that I choose
from a DBCombo bound to a table or the querry (the querry if I can figure
out how to prevent duplicates).

I know I'm missing something, just need help in figuring out what.


Thank you
Rod

2. Very DBA Question.

3. strange table access error using PHP

4. mix and match

5. Strange error using APT

6. error starting sqlserver agent

7. Strange Error using Procedure as Report Record Source

8. How to find "Dictionary Order" ?

9. Strange ODBC errors using DAO to access linked tables in Access .MDB

10. Strange error using AUTOTRACE in SQL*Plus

11. Using ado from asp: strange errors occur

12. Strange error using db link

13. Strange error using a user defined function to return a string