Entire recordset not being exported to excel

Entire recordset not being exported to excel

am 18.08.2006 00:55:05 von sks

Hi all,

I'm trying to export a recordset from a webpage to excel, however, only
part of the recordset does not populate in the excel file. The entire
recordset will populate if I have it write to a web page. I'm using
the following script to initiate the export:

<%Response.ContentType = "application/vnd.ms-excel"%>

The I run my script which queries for the recordset and writes it to
html.

Any ideas why this is happening?

Re: Entire recordset not being exported to excel

am 18.08.2006 08:58:57 von Mike Brind

sks wrote:
> Hi all,
>
> I'm trying to export a recordset from a webpage to excel, however, only
> part of the recordset does not populate in the excel file. The entire
> recordset will populate if I have it write to a web page. I'm using
> the following script to initiate the export:
>
> <%Response.ContentType = "application/vnd.ms-excel"%>
>
> The I run my script which queries for the recordset and writes it to
> html.
>
> Any ideas why this is happening?

Can you describe what you mean by "part" of the recordset? Do you mean
it stops after a certain row? Column? Truncated values? Missing values?

--
Mike Brind

Re: Entire recordset not being exported to excel

am 18.08.2006 11:13:54 von mmcginty

"sks" wrote in message
news:1155855305.795739.194160@i42g2000cwa.googlegroups.com.. .
> Hi all,
>
> I'm trying to export a recordset from a webpage to excel, however, only
> part of the recordset does not populate in the excel file. The entire
> recordset will populate if I have it write to a web page. I'm using
> the following script to initiate the export:
>
> <%Response.ContentType = "application/vnd.ms-excel"%>
>
> The I run my script which queries for the recordset and writes it to
> html.
>
> Any ideas why this is happening?

Not sure this is relevant, but the Excel Object Model method
CopyFromRecordset will skip rows with fields longer than 255 characters.

I pin-pointed it by deriving columns to output the length of each character
column, dumping the data to Excel, and then sorted descending on each of the
[derived] length columns (and comparing to an aggregate query that returned
MAX for each [derived] length column.)

In other words, if there are field values longer than 255 chars in the data,
the rows in which that occurs are suspect, so make them easy to identify,
and make sure they're not the ones you're missing in Excel.

-Mark

Re: Entire recordset not being exported to excel

am 18.08.2006 15:14:39 von sks

Mike Brind wrote:
> sks wrote:
> > Hi all,
> >
> > I'm trying to export a recordset from a webpage to excel, however, only
> > part of the recordset does not populate in the excel file. The entire
> > recordset will populate if I have it write to a web page. I'm using
> > the following script to initiate the export:
> >
> > <%Response.ContentType = "application/vnd.ms-excel"%>
> >
> > The I run my script which queries for the recordset and writes it to
> > html.
> >
> > Any ideas why this is happening?
>
> Can you describe what you mean by "part" of the recordset? Do you mean
> it stops after a certain row? Column? Truncated values? Missing values?
>
> --
> Mike Brind

I mean that of 132 records, only 68 of them will populate and the last
record is missing the last two fields.

Re: Entire recordset not being exported to excel

am 18.08.2006 15:16:36 von sks

Mark J. McGinty wrote:
> "sks" wrote in message
> news:1155855305.795739.194160@i42g2000cwa.googlegroups.com.. .
> > Hi all,
> >
> > I'm trying to export a recordset from a webpage to excel, however, only
> > part of the recordset does not populate in the excel file. The entire
> > recordset will populate if I have it write to a web page. I'm using
> > the following script to initiate the export:
> >
> > <%Response.ContentType = "application/vnd.ms-excel"%>
> >
> > The I run my script which queries for the recordset and writes it to
> > html.
> >
> > Any ideas why this is happening?
>
> Not sure this is relevant, but the Excel Object Model method
> CopyFromRecordset will skip rows with fields longer than 255 characters.
>
> I pin-pointed it by deriving columns to output the length of each character
> column, dumping the data to Excel, and then sorted descending on each of the
> [derived] length columns (and comparing to an aggregate query that returned
> MAX for each [derived] length column.)
>
> In other words, if there are field values longer than 255 chars in the data,
> the rows in which that occurs are suspect, so make them easy to identify,
> and make sure they're not the ones you're missing in Excel.
>
> -Mark

Mark,

I think this is exactly what is happening. The record where the export
fails does have more than 255. I'll have to run some test, but I think
this is the problem. Thanks for you help.

Re: Entire recordset not being exported to excel

am 18.08.2006 19:10:54 von Mike Brind

sks wrote:
> Mike Brind wrote:
> > sks wrote:
> > > Hi all,
> > >
> > > I'm trying to export a recordset from a webpage to excel, however, only
> > > part of the recordset does not populate in the excel file. The entire
> > > recordset will populate if I have it write to a web page. I'm using
> > > the following script to initiate the export:
> > >
> > > <%Response.ContentType = "application/vnd.ms-excel"%>
> > >
> > > The I run my script which queries for the recordset and writes it to
> > > html.
> > >
> > > Any ideas why this is happening?
> >
> > Can you describe what you mean by "part" of the recordset? Do you mean
> > it stops after a certain row? Column? Truncated values? Missing values?
> >
> > --
> > Mike Brind
>
> I mean that of 132 records, only 68 of them will populate and the last
> record is missing the last two fields.

Are the contents of the final field that is populated as you would
expect them? It's not, for example, a bunch of text followed by and
ADODB error?

--
Mike Brind

Re: Entire recordset not being exported to excel

am 21.08.2006 20:17:17 von sks

Mike,

No, it's just text. However, I discovered that I didn't need to export
the field that was causing the problem, so I just deleted it from the
sql statement. Thanks for you help.
Mike Brind wrote:
> sks wrote:
> > Mike Brind wrote:
> > > sks wrote:
> > > > Hi all,
> > > >
> > > > I'm trying to export a recordset from a webpage to excel, however, only
> > > > part of the recordset does not populate in the excel file. The entire
> > > > recordset will populate if I have it write to a web page. I'm using
> > > > the following script to initiate the export:
> > > >
> > > > <%Response.ContentType = "application/vnd.ms-excel"%>
> > > >
> > > > The I run my script which queries for the recordset and writes it to
> > > > html.
> > > >
> > > > Any ideas why this is happening?
> > >
> > > Can you describe what you mean by "part" of the recordset? Do you mean
> > > it stops after a certain row? Column? Truncated values? Missing values?
> > >
> > > --
> > > Mike Brind
> >
> > I mean that of 132 records, only 68 of them will populate and the last
> > record is missing the last two fields.
>
> Are the contents of the final field that is populated as you would
> expect them? It's not, for example, a bunch of text followed by and
> ADODB error?
>
> --
> Mike Brind