Recommended: How to write a website statistics system using ASP Most of the current website statistics systems are CGI, but they are very complicated to write. ASP is simple to learn and has the advantages of combining with databases. So, based on the website statistics system I have done, let me discuss ASP with you. Write a website statistics system. Everyone
I don't know if you have encountered such a space. It limits the size of your database. For example, ACCESS MYSQL is limited to less than 100M. If you feel that this space is very affordable, but the database is limited and you want to use such space. Do it, because I encountered such a problem myself, I wrote a code to share with you. My idea is that a database cannot exceed 100M, so what about ten? 10*100=1G, isn’t your database enough?
The code is as follows (the database is not restricted or can be passed by experts)
Determine the database code:
mdb=request.querystring(mdb)
Call code:
if mdbsort<> then
sql=SELECT top 11 id,name from znwl_article where classid=&mdbsort& order by click DESC
else
sql=SELECT top 11 id,name from znwl_article order by click DESC
end if
set rs=server.createobject(adodb.recordset)
if mdb=1 then
rs.open sql,conn1,1
namesort=wzyy
elseif mdb=2 then
rs.open sql,conn2,1,1
namesort=yjzx
...
else
Response.write information error
end if
Database connection code
'Define the database link file and modify it according to your own situation
Const AccessPath=Database Directory
Const AccessFile=db1.mdb
Const AccessFile1=db2.mdb
...
'Define database connection
Dim Conn1,conn2
On Error Resume Next
Set Conn1= Server.CreateObject(ADODB.Connection)
Conn1.ConnectionString=Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & Server.MapPath(AccessPath&/&AccessFile)
Conn1.Open
'Define database connection 2
Set conn2= Server.CreateObject(ADODB.Connection)
conn2.ConnectionString=Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & Server.MapPath(AccessPath&/&AccessFile1)
conn2.Open
...
The code can be made into classes for easy calling. Friends with ideas can try it yourself.
Friends who use MYSQL databases can write a code according to this idea
Share: ASP 3.0 Advanced Programming (37) 8.2.5 Stream object Stream object is used to access the content of a node, such as an E-Mail message or a web page. Use Stream objects to access the real content of a file or resource. Therefore, combining Record and Recordset objects can not only access the web server