getrows and friends 
Author Message
 getrows and friends

I would like to perform some very simple tasks.
1) Open an ADO recordset
2) Fill an array with the recordset results
3) Close the recordset
4) Fill a Grid with the array
5) Let the user modify the contents of the grid
6) Modify the contents of the array according to the user input
7) When the user closes the form, pass the changes back to the database

I know well the points 1, 2 and 3

What about the fourth? Do I have to fill the grid cell by cell moving
through the array or is there a simpler way (like, I don't know, setting
DataGrid.Datasource = MyArray or DataGrid.DataSource = MyRecordset.getrows)?
For example in the KB article
http://www.*-*-*.com/
n&FR=0&qry=How%20to%20use%20Grid&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VBB the
grid is filled cell by cell, so I guess there is no faster way, but I wonder
if there is anyone who knows something else .

No problems with the fifth and sixth points, but what do I have to do to
pass the data back to the database?
Cycle through the rows performing as many Execute method with "UPDATE"
queries as the changed rows?
Or is there a method which is, let's say, the opposite of the getrows?

I wonder if there is anyone who has an answer or if someone can tell me
where to find (inexpensive ;) ) information about this subject

Any help would be appreciated.
Thanks In Advance
Simona
SHARK srl



Sat, 12 Jul 2003 20:21:41 GMT  
 getrows and friends
Simona,

Why don't you get the recordset, then say datagrid.datasource = recordset.
Let the datagrid do the updating when a user changes something.

Or is there a reason why you want to use an array.

Maurice

Quote:
-----Original Message-----

I would like to perform some very simple tasks.
1) Open an ADO recordset
2) Fill an array with the recordset results
3) Close the recordset
4) Fill a Grid with the array
5) Let the user modify the contents of the grid
6) Modify the contents of the array according to the user input
7) When the user closes the form, pass the changes back to the database

I know well the points 1, 2 and 3

What about the fourth? Do I have to fill the grid cell by cell moving
through the array or is there a simpler way (like, I don't know, setting
DataGrid.Datasource = MyArray or DataGrid.DataSource = MyRecordset.getrows)?
For example in the KB article
http://support.microsoft.com/support/kb/articles/Q143/0/34.asp?LN=EN-...
n&FR=0&qry=How%20to%20use%20Grid&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VBB the
grid is filled cell by cell, so I guess there is no faster way, but I wonder
if there is anyone who knows something else .

No problems with the fifth and sixth points, but what do I have to do to
pass the data back to the database?
Cycle through the rows performing as many Execute method with "UPDATE"
queries as the changed rows?
Or is there a method which is, let's say, the opposite of the getrows?

I wonder if there is anyone who has an answer or if someone can tell me
where to find (inexpensive ;) ) information about this subject

Any help would be appreciated.
Thanks In Advance
Simona
SHARK srl

.



Sat, 12 Jul 2003 21:22:39 GMT  
 getrows and friends


Fri, 19 Jun 1992 00:00:00 GMT  
 getrows and friends
Well, the most relevant problem is that I have to insert some calculated
columns in the grid (calculations that I cannot perform with a simple
Query), so I can't bind the grid directly to the recordset. Is there any
other way?
Simona



Simona,

Why don't you get the recordset, then say datagrid.datasource = recordset.
Let the datagrid do the updating when a user changes something.

Or is there a reason why you want to use an array.

Maurice

Quote:
-----Original Message-----

I would like to perform some very simple tasks.
1) Open an ADO recordset
2) Fill an array with the recordset results
3) Close the recordset
4) Fill a Grid with the array
5) Let the user modify the contents of the grid
6) Modify the contents of the array according to the user input
7) When the user closes the form, pass the changes back to the database

I know well the points 1, 2 and 3

What about the fourth? Do I have to fill the grid cell by cell moving
through the array or is there a simpler way (like, I don't know, setting
DataGrid.Datasource = MyArray or DataGrid.DataSource = MyRecordset.getrows)?
For example in the KB article
http://support.microsoft.com/support/kb/articles/Q143/0/34.asp?LN=EN-...
n&FR=0&qry=How%20to%20use%20Grid&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VBB the
grid is filled cell by cell, so I guess there is no faster way, but I wonder
if there is anyone who knows something else .

No problems with the fifth and sixth points, but what do I have to do to
pass the data back to the database?
Cycle through the rows performing as many Execute method with "UPDATE"
queries as the changed rows?
Or is there a method which is, let's say, the opposite of the getrows?

I wonder if there is anyone who has an answer or if someone can tell me
where to find (inexpensive ;) ) information about this subject

Any help would be appreciated.
Thanks In Advance
Simona
SHARK srl

.



Sat, 12 Jul 2003 21:36:13 GMT  
 getrows and friends


Fri, 19 Jun 1992 00:00:00 GMT  
 getrows and friends
Can you perform your calculations on the values in the recordset before
populating the grid with them? You can make the values read-ready on the way
in by applying your conversions, and then save-ready on the way out by
reversing those conversions.
- Josh


Quote:
> Well, the most relevant problem is that I have to insert some calculated
> columns in the grid (calculations that I cannot perform with a simple
> Query), so I can't bind the grid directly to the recordset. Is there any
> other way?
> Simona



> Simona,

> Why don't you get the recordset, then say datagrid.datasource = recordset.
> Let the datagrid do the updating when a user changes something.

> Or is there a reason why you want to use an array.

> Maurice

> -----Original Message-----
> I would like to perform some very simple tasks.
> 1) Open an ADO recordset
> 2) Fill an array with the recordset results
> 3) Close the recordset
> 4) Fill a Grid with the array
> 5) Let the user modify the contents of the grid
> 6) Modify the contents of the array according to the user input
> 7) When the user closes the form, pass the changes back to the database

> I know well the points 1, 2 and 3

> What about the fourth? Do I have to fill the grid cell by cell moving
> through the array or is there a simpler way (like, I don't know, setting
> DataGrid.Datasource = MyArray or DataGrid.DataSource =

MyRecordset.getrows)?
Quote:
> For example in the KB article

http://support.microsoft.com/support/kb/articles/Q143/0/34.asp?LN=EN-...

- Show quoted text -

Quote:
> n&FR=0&qry=How%20to%20use%20Grid&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VBB the
> grid is filled cell by cell, so I guess there is no faster way, but I
wonder
> if there is anyone who knows something else .

> No problems with the fifth and sixth points, but what do I have to do to
> pass the data back to the database?
> Cycle through the rows performing as many Execute method with "UPDATE"
> queries as the changed rows?
> Or is there a method which is, let's say, the opposite of the getrows?

> I wonder if there is anyone who has an answer or if someone can tell me
> where to find (inexpensive ;) ) information about this subject

> Any help would be appreciated.
> Thanks In Advance
> Simona
> SHARK srl

> .



Sun, 13 Jul 2003 02:07:12 GMT  
 getrows and friends


Fri, 19 Jun 1992 00:00:00 GMT  
 getrows and friends
If you need to actually add columns, not just change values, then you can
build a second recordset instead of an array and populate your grid with
that.
- Josh


Quote:
> Well, the most relevant problem is that I have to insert some calculated
> columns in the grid (calculations that I cannot perform with a simple
> Query), so I can't bind the grid directly to the recordset. Is there any
> other way?
> Simona



> Simona,

> Why don't you get the recordset, then say datagrid.datasource = recordset.
> Let the datagrid do the updating when a user changes something.

> Or is there a reason why you want to use an array.

> Maurice

> -----Original Message-----
> I would like to perform some very simple tasks.
> 1) Open an ADO recordset
> 2) Fill an array with the recordset results
> 3) Close the recordset
> 4) Fill a Grid with the array
> 5) Let the user modify the contents of the grid
> 6) Modify the contents of the array according to the user input
> 7) When the user closes the form, pass the changes back to the database

> I know well the points 1, 2 and 3

> What about the fourth? Do I have to fill the grid cell by cell moving
> through the array or is there a simpler way (like, I don't know, setting
> DataGrid.Datasource = MyArray or DataGrid.DataSource =

MyRecordset.getrows)?
Quote:
> For example in the KB article

http://support.microsoft.com/support/kb/articles/Q143/0/34.asp?LN=EN-...

- Show quoted text -

Quote:
> n&FR=0&qry=How%20to%20use%20Grid&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VBB the
> grid is filled cell by cell, so I guess there is no faster way, but I
wonder
> if there is anyone who knows something else .

> No problems with the fifth and sixth points, but what do I have to do to
> pass the data back to the database?
> Cycle through the rows performing as many Execute method with "UPDATE"
> queries as the changed rows?
> Or is there a method which is, let's say, the opposite of the getrows?

> I wonder if there is anyone who has an answer or if someone can tell me
> where to find (inexpensive ;) ) information about this subject

> Any help would be appreciated.
> Thanks In Advance
> Simona
> SHARK srl

> .



Sun, 13 Jul 2003 02:25:07 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Why warn about: Friend Overridable Sub / Friend MustOverride Sub

2. GetRows Problem Acc 2000 DAO

3. Getrows issue

4. GetRows() Method and Variant data type

5. GetRows returns only first row

6. COM object that returns GetRows Array

7. DataReader does not have GETROWS() !!!!!

8. How to do GetRows()

9. ADO.NET GetRows or Getstring ?

10. Variant arrays and GetRows()

11. GetRows method

12. GetRows Method for DAO

 

 
Powered by phpBB® Forum Software