<%
aranan = request.form("aranan")
Set hak = Server.CreateObject("ADODB.Connection")
hak.Open "odbc" 'ODBC İLE VT BAĞLANTISI
Set hakan = Server.CreateObject("ADODB.Recordset")
SQL = "Select * from TABLO WHERE SUtUN like '%"& aranan &"%' ORDER BY id asc"
hakan.Open SQL,hak,1,3
If hakan.eof then
Response.Write "Kayıt Bulunamadı"
Else
DO WHILE NOT hakan.EOF
response.write hakan("id") &" - "& hakan("SUTUN")
hakan.MoveNext
LOOP
End If
hakan.close
set hakan = nothing
hak.close
set hak = Nothing
%>
<%
'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
%>
conn ile db ye bağlandık.
<%
set rs = server.createobject("adodb.recordset")
sql = "select * from haber where dhaber LIKE '%"&aranan&"%' and onay=1"
rs.open sql, conn, 1, 3
for i = 1 to 12 '12 adet dizmesini istedik.
if rs.eof then exit for
%>
<td height="18" class="yazi">Oy TOPLAM:<%=rs("deger")%> Tarih: <%=rs("tarih")%><br>
<%=rs("kisatanim")%></td>
<%
rs.movenext
Next
rs.close
set rs = Nothing
%>
Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.