Nick Jones <[EMAIL PROTECTED]> wrote on 09/01/2005 03:18:39 PM:

> 
> 
> --- "J.R. Bullington" <[EMAIL PROTECTED]> wrote:
> 
> > Automatically populate??
> > 
> > Not that _I_ know of, but of course there are those
> > on this list that know
> > much more than I. 
> > 
> > I do know that you can export the values into tab
> > delimited format and then
> > import it into Excel.
> > 
> > I think that you may want to do this via ASP or PHP.
> > It would make life a
> > lot easier.
> > 
> > J.R.
> 
> PHP would definitely be the way to go on this. I'm
> working on a web application running on our AS/400
> here running Apache, PHP, and MySQL to automate our
> schedule forms that we fill out daily around here.
> Everything I've got so far is running through
> PHP/MySQL so if I can find a way to do this in PHP I'm
> definitely going to try. I'll google around for awhile
> and see what I come up with. MS Knowledge Base has
> proven to be less than useful so far in my endeavor.
> 
> Also, thanks to James for his suggestion on using the
> ODBC query directly from Excel. This will get us
> started for the time being, and give me some leeway so
> I can work on doing this in PHP.
> 
> Thanks to you both!
> -Nick
> 

The ODBC query is SO simple and flexible once you get through the darn 
wizard just once. I think it will save you a lot of headaches in the long 
run.

Another alternative is to run your query through the MySQL client with the 
HTML output flag turned on and Tee your output to some temp file. Excel 
(at least the modern versions) are HTML aware and will convert the 
<TABLE>, <TR>, <TD>, etc. tags into cells automagically.

Another alternative: I have also changed the Screen Buffer settings of my 
CMD window so that it no longer wraps at 80 columns. I tend to use 
something like 1024 x 2048 but it can get much bigger if you need it to. 
It allows me to catch a whole lot of CLI output before I hit the limits of 
the buffer. Highlight and copy your query results into Word and replace 
all | characters with tabs. I had to use Word as you can't enter the tab 
character into the "replace with" field in Notepad. -OR- paste into 
Notepad and save it off as a temp file. Then import that temp file into 
Excel as | delimited data. Of course if your actual data contains the | 
character, some of your rows will be wider by a column or two....

However, the easiest is still the Import External Data wizard via ODBC. If 
you stick with the PHP solution, remember that Excel will process any 
tab-delimited file into columns and rows as well as it can do anything 
else. If you are really gonzo, you can actually produce a fully formatted 
sheet so long as you conform to the HTML+XML format that Excel uses when 
you click "Save as HTML". That save format IS thoroughly documented in the 
KB (I know I found it recently). 

Options. Way too many options.... ;-D

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Reply via email to