ASP reads Excel table x row y column value

Source: Internet
Author: User
This article describes how ASP reads data from Excel tables, excel2007 supports SQL queries to read data, and Excel can be used as a database.

The following code after my test is available for everyone to refer to.

The code is as follows:

<% ' reads the x row y column set Conn=server.createobject ("ADODB. Connection ") Set Rs=server.createobject (" ADODB. Recordset ") strconn=" Provider=Microsoft.Jet.OLEDB.4.0;Data source= "+server.mappath (" 1.xls ") +"; Extended properties= ' Excel 8.0; Hdr=no;imex=1 ' "Conn.Open strconnfunction getxy (table,x,y) sql=" SELECT * FROM ["&table&" $] "Rs. Open sql,conn,1,1if not rs.eof then Rs.move x-1 getxy=rs (y-1) elsegetxy= "" End IFRS. Closeconn.closeset rs = NothingSet Conn = nothingend functionresponse.write getxy ("Civil marriage Registration", 3,4)%>

I am provided by topic.alibabacloud.com, I am topic.alibabacloud.com author "Ty80".

Article Address: http://www.php.cn/csharp-article-377119.html

Learn programming to topic.alibabacloud.com www.php.cn

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.