Accessing Excel data via odbc

Results 1 to 2 of 2

Thread: Accessing Excel data via odbc

  1. #1
    Join Date
    Dec 1969
    Posts
    6

    Default Accessing Excel data via odbc

    I want to display excel data using odbc and ado.<BR>Ho do i retrive column values using ado?

  2. #2
    Join Date
    Dec 1969
    Posts
    1,019

    Default RE: Accessing Excel data via odbc

    Make your DSN using the Microsoft Excel Driver & open as any other DSN.<BR>To take the column values out:<BR>set myExcel=conn.Execute ("SELECT * FROM `Sheet1$`")<BR>where the name of the spreadhseet is Sheet1 - you must add the dollar sign ($) and enclose the whole thing is single quotes (&#039).<BR>to write the data, either use the ordinal ref or column headers:<BR>response.write myExcel(0) & chr(44) & response.write myExcel(1)<BR>where 0 is the first column,1 the second column, etc. (ordinal)<BR>Or <BR>response.write myExcel("UserName")<BR>where UserName is the heading for the first column<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •