From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b424ec4b490c1d84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Andrew" Newsgroups: comp.lang.ada Subject: excel files Date: Wed, 6 Oct 2004 15:58:26 -0600 Organization: Cuivre, Argent, Or Message-ID: References: <20041006203015.B3B864C40D1@lovelace.ada-france.org> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1097098705 39225 212.85.156.195 (6 Oct 2004 21:38:25 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 6 Oct 2004 21:38:25 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:4843 Date: 2004-10-06T15:58:26-06:00 Ooops, I have a correction to the code I posted. ============ code below =============== <% @Language = "JavaScript" %> <% /* * The provider is the path to the excel file. The path provided here is a relative path. * It is later combined with a call to Server.MapPath to generate the absolute path. */ var provider = "\data\\NameOfExcelFile.xls"; /* * Our connection information. */ var cn = "Driver={Microsoft Excel Driver (*.xls)}; DBQ=" + Server.MapPath(provider); /* * Our recordset object to manipulate contents of the provider. * We are using ADODB, the connection is an ODBC connection. */ var objRecordSet = Server.CreateObject("ADODB.Recordset"); /* * Gives me the columns from the database. * Cheese is a named region in the spreadsheet. To get a whole sheet * we would have to use $Sheet# instead of Cheese. */ SQL = "SELECT * FROM Cheese"; objRecordSet.Open(SQL, cn); /* * Just output name=value pairs within the recordset. one per line. */ objFields = objRecordSet.Fields; while(!objRecordSet.EOF){ for(i=0; i < objFields.Count; i++){ Response.write(objFields.Item(i).Name+ " = " +objFields.Item(i).Value+"
"); } Response.write("
"); objRecordSet.MoveNext(); } /* * Don't forget to close the objects */ if(objRecordSet.State != adStateClosed){ objRecordSet.close(); } %> ============ end code ================