[Zope] SQL to Excel Redux

Christian.Fissgus@haufe.de Christian.Fissgus@haufe.de
Tue, 7 May 2002 15:55:22 +0200


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--------------InterScan_NT_MIME_Boundary
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C1F5CE.D48A3520"

------_=_NextPart_001_01C1F5CE.D48A3520
Content-Type: text/plain;
	charset="iso-8859-1"


> Okay, now that's fixed, I'm getting the error I initially expected:
> 
> Error Type: KeyError
> Error Value: Company_Name
> 
> This doesn't surprise me, as the Browse tab on the ODBC connector comes up
> empty, and this being an Excel spreadsheet, not a database table proper,
> there are no field names specifically assigned to the data.
> 
> Now, where should the field names be declared/assigned?

The best way would be to insert a new first row in your excel-sheet with the
field names you want.
Or: use the names which are shown when you test your ZSQL method.

>
> And as a more general question, in the ODBC connector docs, it says that
not
> all databases support browsing...what is the specific limitation? I've
been
> able to browse both Access and FoxPro databases, and I find it an
invaluable
> tool. The Excels spreadsheet is the first thing that's ever come up blank
> for me, and that's kind of an odd duck anyway...

If you really want to use the Browse tab, you have to use named ranges in 
your excel sheet (look in your excel manual how to name ranges); 
then you will see the named ranges just like 'normal' tables in a database.
(and you can also do something like "select * from nameOfRange " as ZSQL
method ...)

chris

 

------_=_NextPart_001_01C1F5CE.D48A3520
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Zope] SQL to Excel Redux</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>&gt; Okay, now that's fixed, I'm getting the error I initially expected:</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Error Type: KeyError</FONT>
<BR><FONT SIZE=2>&gt; Error Value: Company_Name</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; This doesn't surprise me, as the Browse tab on the ODBC connector comes up</FONT>
<BR><FONT SIZE=2>&gt; empty, and this being an Excel spreadsheet, not a database table proper,</FONT>
<BR><FONT SIZE=2>&gt; there are no field names specifically assigned to the data.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Now, where should the field names be declared/assigned?</FONT>
</P>

<P><FONT SIZE=2>The best way would be to insert a new first row in your excel-sheet with the field names you want.</FONT>
<BR><FONT SIZE=2>Or: use the names which are shown when you test your ZSQL method.</FONT>
</P>

<P><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; And as a more general question, in the ODBC connector docs, it says that not</FONT>
<BR><FONT SIZE=2>&gt; all databases support browsing...what is the specific limitation? I've been</FONT>
<BR><FONT SIZE=2>&gt; able to browse both Access and FoxPro databases, and I find it an invaluable</FONT>
<BR><FONT SIZE=2>&gt; tool. The Excels spreadsheet is the first thing that's ever come up blank</FONT>
<BR><FONT SIZE=2>&gt; for me, and that's kind of an odd duck anyway...</FONT>
</P>

<P><FONT SIZE=2>If you really want to use the Browse tab, you have to use named ranges in </FONT>
<BR><FONT SIZE=2>your excel sheet (look in your excel manual how to name ranges); </FONT>
<BR><FONT SIZE=2>then you will see the named ranges just like 'normal' tables in a database.</FONT>
<BR><FONT SIZE=2>(and you can also do something like &quot;select * from nameOfRange &quot; as ZSQL method ...)</FONT>
</P>

<P><FONT SIZE=2>chris</FONT>
</P>

<P><FONT SIZE=2>&nbsp;</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1F5CE.D48A3520--

--------------InterScan_NT_MIME_Boundary--