DBGrid in VB4 - Parameter Queries 
Author Message
 DBGrid in VB4 - Parameter Queries

Hi,

Does anybody know how to make parameter queries work with a DBGrid in
VB4. The help file sais that it is possible by assigning the returned
data to a dynaset type recordset and then assigning that to the
recordset property of the DBGrid. This, however, does not seem to work
in either the 16bit or 32bit envirnments.

If this is not at all possible, does anyone have any suggestions on
how to VERY QUICKLY return a recordset of formated information into a
grid or list of some kind. We are talking about 6 or so columns of
various widths.

Any help would be gratefully accepted. PLease could you e-mail me
responses as I don't get on to the newsgroups all the time. My e-mail

Thanks heaps.

Rhys :-)



Wed, 19 May 1999 03:00:00 GMT  
 DBGrid in VB4 - Parameter Queries

Rhys,

Read the on-line help very carefully.  You can assign the results of a
parameterized querydef to a recordset, but not to a data control's
recordset.  So you must assign the querydef result to a temp recordset and
then in the next line of code, set your data control's recordset equal to
your temp recordset.  Yes, odd but true.  A cannot equal B but A can equal
C and C can equal B.  Finally, bind your grid to the data control.

Note your grid will not "see" the fields until runtime, so designtime
formatting will be a bit awkward.

Dan
--
**************************************************************************
Daniel Poor                                       email:

                                                       phone: 212-735-3000
New York City, NY USA                       fax: 212-735-2001
**************************************************************************



Quote:
> Hi,

> Does anybody know how to make parameter queries work with a DBGrid in
> VB4. The help file sais that it is possible by assigning the returned
> data to a dynaset type recordset and then assigning that to the
> recordset property of the DBGrid. This, however, does not seem to work
> in either the 16bit or 32bit envirnments.

> If this is not at all possible, does anyone have any suggestions on
> how to VERY QUICKLY return a recordset of formated information into a
> grid or list of some kind. We are talking about 6 or so columns of
> various widths.

> Any help would be gratefully accepted. PLease could you e-mail me
> responses as I don't get on to the newsgroups all the time. My e-mail

> Thanks heaps.

> Rhys :-)



Sat, 22 May 1999 03:00:00 GMT  
 DBGrid in VB4 - Parameter Queries

Thanks for the reply . . .

This much I can handle. The problem appears to be with VB4.0 and the
standard DBGrid control. I am currently getting the appropriate
upgrades.

Thanks again.

Rhys :-)

Quote:

>Rhys,

>Read the on-line help very carefully.  You can assign the results of a
>parameterized querydef to a recordset, but not to a data control's
>recordset.  So you must assign the querydef result to a temp recordset and
>then in the next line of code, set your data control's recordset equal to
>your temp recordset.  Yes, odd but true.  A cannot equal B but A can equal
>C and C can equal B.  Finally, bind your grid to the data control.

>Note your grid will not "see" the fields until runtime, so designtime
>formatting will be a bit awkward.

>Dan
>--
>**************************************************************************
>Daniel Poor                                       email:

>                                                       phone: 212-735-3000
>New York City, NY USA                       fax: 212-735-2001
>**************************************************************************



Sun, 23 May 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Silly question -- Parameter Query using DBGrid.

2. Silly question -- Parameter Query using DBGrid.

3. calling parameter query from a parameter query

4. Silly question -- Parameter Query using DBGrid.

5. VB4: Parameter query&Data Control?

6. Query parameter in Vb4

7. Help on Access Query Parameters Through VB4 RDO -ODBC

8. Filling a Parameter through Code (Parameter Query)

9. Using Parameters from VBA Code in a Parameter Query Export

10. parameter query in VBA when parameter not a field

11. Using Parameter Queries with Optional Parameters

12. Parameter query w/ parameter specifying field name?

 

 
Powered by phpBB® Forum Software