|
 |
|
<%
Set adoCon = Server.CreateObject("ADODB.Connection")
'------------- If you are having problems with the script then try using a diffrent driver or DSN by editing the lines below --------------
'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/site.mdb")
'Database driver info for Brinkster
'strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/USERNAME/db/news.mdb") 'This one is for Brinkster users place your Brinster username where you see USERNAME
'Alternative drivers faster than the basic one above
'strCon = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & Server.MapPath("news.mdb") 'This one is if you convert the database to Access 97
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("news.mdb") 'This one is for Access 2000/2002
'If you wish to use DSN then comment out the driver above and uncomment the line below (DSN is slower than the above drivers)
'strCon = "DSN = DSN_NAME" 'Place the DSN where you see DSN_NAME
'---------------------------------------------------------------------------------------------------------------------------------------------
'Set an active connection to the Connection object
adoCon.Open strCon
Dim rsComments 'Database recordset holding the comments for this news item
Dim lngSite_ID 'Holds the News item ID number
Dim blnComments 'Set to true if comments are allowed for this item
If isNull(Request.QueryString("Site_ID")) = True Or isNumeric(Request.QueryString("Site_ID")) = False Then
Response.Write "default.asp"
Else
lngSite_ID = CLng(Request.QueryString("Site_ID"))
End If
Set rsSites = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT Sites.* FROM Sites ORDER BY View_Count DESC;"
rsSites.Open strSQL, adoCon
rsSites.Movefirst
count=1
while not rsSites.eof
Response.Write ""
Response.Write ""
Response.Write ""
Response.Write count
Response.Write ". "
Response.Write rsSites("Site_Title")
Response.Write " (просмотров : "
Response.Write rsSites("View_Count")
Response.Write ")"
Response.Write"
"
Response.Write ""
Response.Write rsSites("Site_Description")
Response.Write " "
Response.Write rsSites("Site_Link")
Response.Write ""
Response.Write ""
Response.Write " | "
Response.Write " "
rsSites.Movenext
count=count+1
wend
rsSites.Close
Set rsSites = Nothing
%>
Добавить сайт в базу данных:
|
|
|
|