Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / August 2006



Tip: Looking for answers? Try searching our database.

Entire recordset not being exported to excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sks - 17 Aug 2006 23:55 GMT
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?
Mike Brind - 18 Aug 2006 07:58 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
>
> 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
sks - 18 Aug 2006 14:14 GMT
> > Hi all,
> >
[quoted text clipped - 15 lines]
> --
> Mike Brind

I mean that of 132 records, only 68 of them will populate and the last
record is missing the last two fields.
Mike Brind - 18 Aug 2006 18:10 GMT
> > > Hi all,
> > >
[quoted text clipped - 18 lines]
> 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
sks - 21 Aug 2006 19:17 GMT
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.
> > > > Hi all,
> > > >
[quoted text clipped - 25 lines]
> --
> Mike Brind
Mark J. McGinty - 18 Aug 2006 10:13 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
>
> 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
sks - 18 Aug 2006 14:16 GMT
> > Hi all,
> >
[quoted text clipped - 23 lines]
>
> -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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.