<%
'adovbs.inc'den sabitler
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001
Const PAGE_SIZE = 10 '** Diğer sayfaların boyutu.
'** Değişkenleri oluşturuyoruz
Dim strhit
Dim cnnara ' ** ADO bağlantısı
Dim rstara ' ** ADO kayıtseti
Dim strSQL
Dim strara
Dim iPageCurrent
Dim iPageCount
Dim iRecordCount
Dim I
strhit = Request.ServerVariables("hit")
strara = Request.QueryString("ara")
Set sur=Server.CreateObject("Adodb.Connection")
sur.Open "driver={SQL Server};server=212.120.0.1;uid=user;pwd=12345678;database=ismi"
Set yeniasp = Server.CreateObject("ADODB.Recordset")
sor = "Select * from aranan"
yeniasp.Open sor,sur,1,3
yeniasp.AddNew
yeniasp("keyword")=strara
yeniasp.update
yeniasp.Close
Set yeniasp = Nothing
If Request.QueryString("sayfa") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("sayfa"))
End If
%>
<%
If strara <> "" Then
'** Veritabanımızın yolunu aşağıya yazalım.
Set cnnara = Server.CreateObject("ADODB.Connection")
cnnara.Open "Provider=SQLOLEDB;Data Source=212.120.0.1;" _
& "Initial Catalog=dataadi;User Id=user;Password=12345678;" _
& "Connect Timeout=15;datadi Library=tabloadi;"
' ** Eğer SQL server kullanıyorsanız aşağıdaki satırı kullanınız:
' cnnara.Open Application("SQLConnString")
strSQL = "SELECT script_adi, versiyon, tanim, telif, lisans, boyut, hit, os, id " _
& "FROM download " _
& "WHERE script_adi LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR tanim LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR versiyon LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR telif LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR id LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR lisans LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR os LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR boyut LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "OR hit LIKE '%" & Replace(strara, "'", "''") & "%' " _
& "ORDER BY id DESC;"
Set rstara = Server.CreateObject("ADODB.Recordset")
rstara.PageSize = PAGE_SIZE
rstara.CacheSize = PAGE_SIZE
' **Kayıtsetimizi açalım
rstara.Open strSQL, cnnara, adOpenStatic, adLockReadOnly, adCmdText
iRecordCount = rstara.RecordCount
iPageCount = rstara.PageCount
If iRecordCount = 0 Then
' **Kayıt bulunamadı hatasını göster
%>