Results 1 to 3 of 3

Thread: Excel

  1. #1
    Join Date
    Dec 1969

    Default Excel

    Hi, I am a new ASP user, I don’t know how to write the SQL to call some record.<BR>I have a Excel spreadsheet. The file named is Customer.xls<BR>It only have 1 sheet named sheet1. It contains 10 column from A-J.<BR><BR>I need to display column A, B, C and J on a table.<BR><BR>My SQL statement like below:<BR>&#060;% <BR>myDSN="DSN=customer"<BR><BR>mySQL="select A, B, C, J from sheet1"<BR>set conn=server.createobject("adodb.connection")<BR>co nn.open myDSN<BR>set rs=conn.execute(mySQL)<BR>.<BR>.<BR>.<BR>%&#062;<B R>anything wrong with mySQL, the message is &#039cannot find the object “sheet1”&#039<BR>Please teach me, Thanks in advance<BR>

  2. #2
    KPW Guest

    Default RE: Excel

    In your Excel spreadsheet, you need to create a range that includes all of your data. The name of the range will be used in your mySQL variable.<BR><BR>mySQL="select A,B,C,J from Range1"<BR><BR>(assuming that the range was named "Range1")<BR><BR>The following Microsoft KB article should help.<BR><BR>http://support.microsoft.com/support/kb/articles/Q195/9/51.asp<BR><BR>Hope this helps!

  3. #3
    Join Date
    Dec 1969

    Default Thank you very much

    Thank you very much

Posting Permissions

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