GetString and Clip 
Author Message
 GetString and Clip

I am using ADO 2.1 and use the recordset.getstring method to populate my
flexgrid
Its fast and extremly handy when not using bound grids. But I am facing a
strange problem
When the recordset has a few hundred records, there isnt any problem
But when the records exceed a few thousand, some of the records spill out
into more than one row
I am have not been able to figure out the reason
Any Ideas ???

Here is an example of what I do

Dim rsVar as variant
rsVar=rst.getstring(adClipString, rst.recordcount)
' assume rst to be a open recordset with > 0 records , cursortype static,
source is a table

With fGrid
    .rows=rst.recordcount+2
    .Cols = rst.Fields.Count + 1
    set rst = nothing
   .Row = 1
   .Col = 1
   .RowSel = .Rows - 1
   .ColSel = .Cols - 1

   .Clip = rsVar

   .RowSel = .Row
   .ColSel = .Col
End with

What is the problem ? Why does it work with lesser records
Thanks for any light u can throw  into this

Regards,
Mujahid



Tue, 19 Feb 2002 03:00:00 GMT  
 GetString and Clip
Hi!

I think you got trapped by the same feature as I did...

Problem is that .GetString will return a string with the fields
tab-separated, but if you have tab in some of your textfields,
.Clip will not be able to know the difference of the seperating
tab and the tab in the text. So it skips to the next column on
every tab, and you get this strange "overflow".

Nils


Quote:
> I am using ADO 2.1 and use the recordset.getstring method to populate
> my flexgrid Its fast and extremly handy when not using bound grids.
But
> I am facing a strange problem When the recordset has a few hundred
> records, there isnt any problem But when the records exceed a few
> thousand, some of the records spill out into more than one row
> I am have not been able to figure out the reason
> Any Ideas ???
> Dim rsVar as variant
> rsVar=rst.getstring(adClipString, rst.recordcount)
> With fGrid
>    .Clip = rsVar



Tue, 19 Feb 2002 03:00:00 GMT  
 GetString and Clip
Yes that must be the problem

What I had done was create a class module, so that I could use it everytime
for any table. The table with 3000 + records does have txtfields and tabs
inside them
And the same problem isnt there in other tables.
U r on target
Thanks
Is there any work around ?

Regards
Mujahid

Quote:

>Hi!

>I think you got trapped by the same feature as I did...

>Problem is that .GetString will return a string with the fields
>tab-separated, but if you have tab in some of your textfields,
>.Clip will not be able to know the difference of the seperating
>tab and the tab in the text. So it skips to the next column on
>every tab, and you get this strange "overflow".

>Nils


>> I am using ADO 2.1 and use the recordset.getstring method to populate
>> my flexgrid Its fast and extremly handy when not using bound grids.
>But
>> I am facing a strange problem When the recordset has a few hundred
>> records, there isnt any problem But when the records exceed a few
>> thousand, some of the records spill out into more than one row
>> I am have not been able to figure out the reason
>> Any Ideas ???
>> Dim rsVar as variant
>> rsVar=rst.getstring(adClipString, rst.recordcount)
>> With fGrid
>>    .Clip = rsVar



Wed, 20 Feb 2002 03:00:00 GMT  
 GetString and Clip
Hi.

I have only found cludges with the .Clip-method so far.
So I just loop through the records and fields and fill the
grid that way. Seems to me that if you want to fill a grid
with enough records to make this last method too slow,
you are trying to show the user to many records, anyway.

Nils


Quote:
> Yes that must be the problem
> Is there any work around ?

> >I think you got trapped by the same feature as I did...
> >Problem is that .GetString will return a string with the fields
> >tab-separated, but if you have tab in some of your textfields,
> >.Clip will not be able to know the difference of the seperating
> >tab and the tab in the text. So it skips to the next column on
> >every tab, and you get this strange "overflow".

>>> I am facing a strange problem When the recordset has a few hundred
>>> records, there isnt any problem But when the records exceed a few
>>> thousand, some of the records spill out into more than one row
>>> I am have not been able to figure out the reason
>>> Any Ideas ???
>>> Dim rsVar as variant
>>> rsVar=rst.getstring(adClipString, rst.recordcount)
>>> With fGrid
>>>    .Clip = rsVar



Thu, 21 Feb 2002 03:00:00 GMT  
 GetString and Clip

Hi there..

Like I said in my prevoius posting...I am not controlling the source of the
Records. I am using the clip property, the size of the fields , the headers
etc and controling the width of each column accordingly and populating the
grid. And it doesnt matter if the user has 1 row and 100000 , it doesnt
matter if
he chooses a query, view or a table it must work under any circumstances.
Therefore I need to be prepared for any eventuality. I must add , it is
extremly fast .It has worked except for the drawback with Clip getting
confused with Tabs inside field values. As u rightly pointed out,  looping
through and filling the grid is slow when there are so
many records. Its kinda like a no-win situation and a compromise has to be
made somewhere.
Thanks for ur feedback. It really helped me

Mujahid



Quote:
> Hi.

> I have only found cludges with the .Clip-method so far.
> So I just loop through the records and fields and fill the
> grid that way. Seems to me that if you want to fill a grid
> with enough records to make this last method too slow,
> you are trying to show the user to many records, anyway.

> Nils


> > Yes that must be the problem
> > Is there any work around ?

> > >I think you got trapped by the same feature as I did...
> > >Problem is that .GetString will return a string with the fields
> > >tab-separated, but if you have tab in some of your textfields,
> > >.Clip will not be able to know the difference of the seperating
> > >tab and the tab in the text. So it skips to the next column on
> > >every tab, and you get this strange "overflow".

> >>> I am facing a strange problem When the recordset has a few hundred
> >>> records, there isnt any problem But when the records exceed a few
> >>> thousand, some of the records spill out into more than one row
> >>> I am have not been able to figure out the reason
> >>> Any Ideas ???
> >>> Dim rsVar as variant
> >>> rsVar=rst.getstring(adClipString, rst.recordcount)
> >>> With fGrid
> >>>    .Clip = rsVar



Fri, 22 Feb 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. GetString and Clip

2. GetString and Clip

3. Problem with ASCIIEncoding.GetString

4. ADO.NET GetRows or Getstring ?

5. Using ADO GetString with MSHFlexgrid - problem with memo field

6. GetString Problem

7. What is the reverse of GetString?

8. getrows or getstring

9. ADO abd Getstring Method

10. GetString limitations

11. ado recordset.getstring problem

12. Out of space using GetString?

 

 
Powered by phpBB® Forum Software