Adding a field to the field collection?

Adding a field to the field collection?

Post by Denni » Sat, 14 Jul 2001 10:59:41



Since it seems impossible to query two database files with one query,
I'm ok with two queries and two recordsets.  The problem now is that I
need to add a field to the ADO recordset (has to be ADO for the report
facility) to contain a 40 char, name, which gets filled in with my
look-up proc.  I see there is a <rs>.Fields.Append method, but I get
argument agreement errors.  Anyone have an example of how to use this
method, or a better idea?  

Thanks,
Dennis

 
 
 

Adding a field to the field collection?

Post by Sukesh Hooga » Sat, 14 Jul 2001 15:29:06


Hello Dennis
Try

rs.Fields.Append "SomeName", adChar, 40

HTH
Sukesh


Quote:> Since it seems impossible to query two database files with one query,
> I'm ok with two queries and two recordsets.  The problem now is that I
> need to add a field to the ADO recordset (has to be ADO for the report
> facility) to contain a 40 char, name, which gets filled in with my
> look-up proc.  I see there is a <rs>.Fields.Append method, but I get
> argument agreement errors.  Anyone have an example of how to use this
> method, or a better idea?

> Thanks,
> Dennis


 
 
 

Adding a field to the field collection?

Post by Denni » Sat, 14 Jul 2001 21:51:04


Thanks Sukesh, it works fine.  However (there's alsways something),
when the query is run [ Set rs = Conn.Execute(Query) ], the field gets
replaced by the fields from the query.  
   So I'm back where I started from - I have two database files that
have tables that I need to get information, it has to be ADO to use MS's
report facility, and no way in heck to do it!  
   [Ranting starts here] I just can't believe that this problem is so
uncommon that ADO has no way to do it.  Surley there are applications
that pull data from tables on the corp. mainframe, the local server, and
somewhere else.  The answer (in my case) is the heck with normalization
- put the same data in all tables so I can get it back again!  [Ranting
done - have a nice day]

Dennis,


> Hello Dennis
> Try

> rs.Fields.Append "SomeName", adChar, 40

> HTH
> Sukesh



> > Since it seems impossible to query two database files with one query,
> > I'm ok with two queries and two recordsets.  The problem now is that I
> > need to add a field to the ADO recordset (has to be ADO for the report
> > facility) to contain a 40 char, name, which gets filled in with my
> > look-up proc.  I see there is a <rs>.Fields.Append method, but I get
> > argument agreement errors.  Anyone have an example of how to use this
> > method, or a better idea?

> > Thanks,
> > Dennis

 
 
 

Adding a field to the field collection?

Post by Sukesh Hooga » Sat, 14 Jul 2001 23:51:02


Hello Dennis

I do not know if this will work, but have you tried using MSFlexGrid (using
its TextMatrix method) to display data from two recordsets ?

Happy Computing

Sukesh


> Thanks Sukesh, it works fine.  However (there's alsways something),
> when the query is run [ Set rs = Conn.Execute(Query) ], the field gets
> replaced by the fields from the query.
>    So I'm back where I started from - I have two database files that
> have tables that I need to get information, it has to be ADO to use MS's
> report facility, and no way in heck to do it!
>    [Ranting starts here] I just can't believe that this problem is so
> uncommon that ADO has no way to do it.  Surley there are applications
> that pull data from tables on the corp. mainframe, the local server, and
> somewhere else.  The answer (in my case) is the heck with normalization
> - put the same data in all tables so I can get it back again!  [Ranting
> done - have a nice day]

> Dennis,


> > Hello Dennis
> > Try

> > rs.Fields.Append "SomeName", adChar, 40

> > HTH
> > Sukesh



> > > Since it seems impossible to query two database files with one query,
> > > I'm ok with two queries and two recordsets.  The problem now is that I
> > > need to add a field to the ADO recordset (has to be ADO for the report
> > > facility) to contain a 40 char, name, which gets filled in with my
> > > look-up proc.  I see there is a <rs>.Fields.Append method, but I get
> > > argument agreement errors.  Anyone have an example of how to use this
> > > method, or a better idea?

> > > Thanks,
> > > Dennis

 
 
 

Adding a field to the field collection?

Post by Denni » Sun, 15 Jul 2001 00:27:31


Sukesh,
   I thought about it, but I don't have time to change all of the report
code to use someting else.  I have to have all changes done in one week,
so using a different control is out of the question for now.  Besides, I
may end up needing data from three tables, so the control would not do
what I need.  Though, I will consider a report creation program that
will work with DAO and dump all the ADO junk.
   There is a way to do this that may work - just very slow.
   1.  Create the final recordset in memory using the Field.Append.
   2.  Query all of the databases and get a number of recordsets.
   3.  Use code to add and alter records inthe final recordset.
   4.  Use the final recordset for the report facility.
   This will take too much time for now, and will tie up the processor
to go through up to 100K records.

Dennis,


> Hello Dennis

> I do not know if this will work, but have you tried using MSFlexGrid (using
> its TextMatrix method) to display data from two recordsets ?

> Happy Computing

> Sukesh



 
 
 

Adding a field to the field collection?

Post by Sukesh Hooga » Sun, 15 Jul 2001 00:48:38


Dennis

so using a different control is out of the question for now

MSFlexGrid would be an add-on to your ADO for display only
Anyway, you know best and alos your priorities

I am also looking at datagrid control to see if that helps

Best regards

Sukesh


> Sukesh,
>    I thought about it, but I don't have time to change all of the report
> code to use someting else.  I have to have all changes done in one week,
> so using a different control is out of the question for now.  Besides, I
> may end up needing data from three tables, so the control would not do
> what I need.  Though, I will consider a report creation program that
> will work with DAO and dump all the ADO junk.
>    There is a way to do this that may work - just very slow.
>    1.  Create the final recordset in memory using the Field.Append.
>    2.  Query all of the databases and get a number of recordsets.
>    3.  Use code to add and alter records inthe final recordset.
>    4.  Use the final recordset for the report facility.
>    This will take too much time for now, and will tie up the processor
> to go through up to 100K records.

> Dennis,


> > Hello Dennis

> > I do not know if this will work, but have you tried using MSFlexGrid
(using
> > its TextMatrix method) to display data from two recordsets ?

> > Happy Computing

> > Sukesh



 
 
 

1. Add Field contents to Collection?

I have created a Collection and need to fill it with all the Records for a
particular Field (in Access).  I can add literal values to the collection using
the Add method, but cannot tell the program to pull values from this particular
field (which cannot be added as literals, unless I typed each value into into
code and never changed the database). Someone wrote that there's no shortcut
and that I would have to add each value one at a time with a loop. However, I
still don't know how to program the code to read the values in this field.

Please Help,
Jeff

2. An easy way to execute a SQL statement!

3. Add field with Boolean field type failed using ADOX

4. Query to return the first day of the current week

5. Adding Fields to Field List

6. Does "delivering" an application improve speed?

7. Adding value to field that is linked to autonumber field

8. Log File Problem with SQL 7 to 2000 Migration

9. Adding a Number Field to a Time Field

10. Adding 2 fields depending on 1 field in the same record

11. Adding a field to the field-definitions using Diamond Access

12. To add a field of the type Dates with a field of the Whole type

13. Adding two fields to one field ??