This article mainly introduces the relevant information of asp to implement the function of obtaining the specified conditional row number of MSSQL database table. Friends who need it can refer to it.
Copy the code code as follows:'Database table row number function, this is the number of rows in the table
Function GetTblRows(TblName)
'If the TblName table name value is empty, then
if TblName= Then
GetTblRows=UnknownTblName
exit Function
Else
set rec = server.createobject(adodb.recordset)
SQL=EXEC sp_spaceused &TblName
rec.open sql,conn,1,1
GetTblRows=Trim(rec(rows))
rec.close
set rec=nothing
end if
End Function
How to use?
Copy the code code as follows:<%=GetTblRows(table name)%>
The above is all the content described in this article, I hope you all like it.