ASP如何获取SQL中某一列的最大值并赋值给一个变量
麻烦的就不敲了,只发关键部分
<%
dim Conn
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Connectionstring="provider=SQLOLEDB;data soource=(local);initial catalog=ASP;user id=sa;password=1234;"
'调用Connection的Execute方法执行SQL语句
Set rsc=Conn.Execute("select MAX(id) from tab_article")
Response.Write ......
%>
如何修改上面语句,将查询到的最大ID赋值给一个变量,然后输出这个变量的值到屏幕
------解决方案--------------------Set rsc=Conn.Execute("select MAX(id) as id from tab_article")
resonse.write rsc("id")
好像是这样