<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sniper &#187; ASP</title>
	<atom:link href="http://tuncay.kinali.net/kategoriler/asp/feed" rel="self" type="application/rss+xml" />
	<link>http://tuncay.kinali.net</link>
	<description>Hafızamın bir kısmı</description>
	<lastBuildDate>Wed, 24 Feb 2010 11:03:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IIS7&#8242;de ASP ile MS Access Veritabanına Bağlanma</title>
		<link>http://tuncay.kinali.net/iis7de-asp-ile-ms-access-veritabanina-baglanma.html</link>
		<comments>http://tuncay.kinali.net/iis7de-asp-ile-ms-access-veritabanina-baglanma.html#comments</comments>
		<pubDate>Wed, 06 May 2009 18:43:27 +0000</pubDate>
		<dc:creator>Sniper</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[Windows 2003]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[İpuçları]]></category>
		<category><![CDATA[belirtilmemiş hata]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[Microsoft JET Database Engine error 080004005]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[vista]]></category>

		<guid isPermaLink="false">http://tuncay.kinali.net/?p=78</guid>
		<description><![CDATA[IIS7&#8242;de, ASP ile MS Access veritabanına bağlantı kurulmak istendiğinde &#8220;Microsoft JET Database Engine hata &#8216;80004005&#8242;&#8221; koduyla &#8220;Belirtilmemiş hata&#8221; oluşur. Bu hataya, ilgili Uygulama Havuzuna kullanıcı profilinin yüklenmesi neden olur. Bu sorunu ortadan kaldırmak için 2 farklı yöntem izlenebilir.

YÖNTEM 1:

IIS&#8217;i açın.
Uygulama Havuzları&#8216;na tıklayın.
Sağdan ilgili uygulama havuzuna sağ tıklayın ve &#8220;Gelişmiş Ayarlar&#8220;ı seçin.
Açılan pencerede &#8220;İşlem Modeli&#8221; başlığı [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://tuncay.kinali.net/wp-content/uploads/2009/05/iis7-150x150.jpg" alt="IIS7" title="IIS7" width="150" height="150" class="alignleft size-thumbnail wp-image-80" />IIS7&#8242;de, ASP ile MS Access veritabanına bağlantı kurulmak istendiğinde &#8220;<strong>Microsoft JET Database Engine hata &#8216;80004005&#8242;</strong>&#8221; koduyla &#8220;<strong>Belirtilmemiş hata</strong>&#8221; oluşur. Bu hataya, ilgili Uygulama Havuzuna kullanıcı profilinin yüklenmesi neden olur. Bu sorunu ortadan kaldırmak için 2 farklı yöntem izlenebilir.<span id="more-78"></span></p>
<div style="clear:both">
<strong>YÖNTEM 1:</strong></p>
<ul>
<li>IIS&#8217;i açın.</li>
<li><strong>Uygulama Havuzları</strong>&#8216;na tıklayın.</li>
<li>Sağdan ilgili uygulama havuzuna sağ tıklayın ve &#8220;<strong>Gelişmiş Ayarlar</strong>&#8220;ı seçin.</li>
<li>Açılan pencerede &#8220;<strong>İşlem Modeli</strong>&#8221; başlığı altındaki &#8220;<strong>Kullanıcı Profilini Yükle</strong>&#8221; seçeneğinin değerini &#8220;<strong>False</strong>&#8221; olarak değiştirin.</li>
<li>&#8220;<strong>Tamam</strong>&#8221; butonuna tıklayarak pencereyi kapatın.</li>
<li>Uygulama Havuzuna sağ tıklayıp &#8220;<strong>Durdur</strong>&#8220;a tıklayın.</li>
<li>Tekrar sağ tıklayıp &#8220;<strong>Başlat</strong>&#8220;a tıklayın.</li>
<li>İşlem bitmiştir, çalışmayan sayfanızı refresh edebilirsiniz.</li>
</ul>
<p><strong>YÖNTEM 2:</strong></p>
<ul>
<li><strong>Win+R</strong> kısayoluyla &#8220;<strong>Çalıştır</strong>&#8221; ekranını açın.</li>
<li>&#8220;<strong>cmd</strong>&#8221; yazıp komut satırını çalıştırın.</li>
<li>Aşağıda yazılı koddaki &#8220;[name='<strong>DefaultApplicationPool</strong>']&#8221; değerini kendi Uygulama Havuzunuza göre ayarlayın, komut satırına kopyalayın ve enterlayın.</li>
<li>&#8220;<strong>Değişiklikler uygulandı</strong>&#8221; mesajı aldıysanız IIS&#8217;i ( ya da en azından Uygulama Havuzunu) restart edin.</li>
</ul>
</div>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p78code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p782"><td class="code" id="p78code2"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span>windir<span style="color: #000000; font-weight: bold;">%</span>\system32\inetsrv\appcmd <span style="color: #000000; font-weight: bold;">set</span> config <span style="color: #000000; font-weight: bold;">/</span>section:applicationPools <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">name</span>=<span style="color: #ff0000;">'DefaultAppPool'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>.processModel.loadUserProfile:<span style="color: #c20cb9; font-weight: bold;">false</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tuncay.kinali.net/iis7de-asp-ile-ms-access-veritabanina-baglanma.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP Dosyalarınızı DLL&#8217;e çevirin</title>
		<link>http://tuncay.kinali.net/asp-dosyalarinizi-dlle-cevirin.html</link>
		<comments>http://tuncay.kinali.net/asp-dosyalarinizi-dlle-cevirin.html#comments</comments>
		<pubDate>Tue, 10 Mar 2009 18:23:50 +0000</pubDate>
		<dc:creator>Sniper</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp to dll]]></category>
		<category><![CDATA[asp2dll]]></category>
		<category><![CDATA[dll]]></category>

		<guid isPermaLink="false">http://kinali.net/?p=10</guid>
		<description><![CDATA[Çoğumuz yazdığımız ASP kodlarını yetkisiz kişilerden saklamak isteriz. Özellikle bir sistem üzerinde oldukça yoğun bir çalışma yaptıktan sonra ortaya çıkardığımız eserin kodlarının başkaları tarafından kullanılmasını engellemek için çeşitli güvenlik önlemleri almak isteriz. Bu yazıda güvenlik önlemlerine ek olarak elimden geldiğince ASP dosyalarımızı DLL olarak kaydetmeyi ve kodlarımızı gizlemeyi anlatmaya çalışacağım.

Kodlarımızı DLL haline getirmek için elimizde [...]]]></description>
			<content:encoded><![CDATA[<p>Çoğumuz yazdığımız ASP kodlarını yetkisiz kişilerden saklamak isteriz. Özellikle bir sistem üzerinde oldukça yoğun bir çalışma yaptıktan sonra ortaya çıkardığımız eserin kodlarının başkaları tarafından kullanılmasını engellemek için çeşitli güvenlik önlemleri almak isteriz. Bu yazıda güvenlik önlemlerine ek olarak elimden geldiğince ASP dosyalarımızı DLL olarak kaydetmeyi ve kodlarımızı gizlemeyi anlatmaya çalışacağım.<br />
<span id="more-10"></span><br />
Kodlarımızı DLL haline getirmek için elimizde iki şeyin olması kâfi. Birincisi bir metin editörü (notepad bile yeter) ikincisi ise Visual Basic 6.0. Malzemelerimiz hazırsa tarifimize geçelim. Öncelikle basit bir ASP sayfası oluşturalım. Benim örneğim altta, siz kafanıza göre birşeyler karalayabilirsiniz.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code8'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p108"><td class="code" id="p10code8"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;ASP kodlarını DLL üzerinden çalıştırma denemesi&lt;/title&gt;&quot;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;/head&gt;&lt;body&gt;&lt;font color=&quot;</span><span style="color: #cc0000;">&quot;#FF0000&quot;</span><span style="color: #cc0000;">&quot; size=2 face=&quot;</span><span style="color: #cc0000;">&quot;trebuchet ms&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;Bu sayfa bir DLL dosyasından türetilmiştir.&lt;/font&gt;&lt;/body&gt;&quot;</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

<p>Bu sayfamıza herhangi bir isim vererek şimdilik bir kenara kaydedelim. Bu haliyle kullanmayacağız ama yine de baştan hazırlayalım dedim. Şimdi Visual Basic programımızı DLL oluşturacak şekilde açalım. Bunun için izlememiz gereken yol şöyle:</p>
<ol type="1">
<li>Visual Basic programını açıp File menüsünden New&#8217;i tıklayın.</li>
<li>Açılan pencereden ActiveX DLL seçeneğini işaretleyip OK&#8217;a tıklayın.
</li>
<li>Projemize ASP nesnelerini eklemek için Project menüsünden References seçeneğine tıklayın.
</li>
<li>Açılan pencereden Microsoft Active Server Pages Object Library&#8217;i bulup işaretleyin ve OK&#8217;a tıklayın.</li>
</ol>
<p>Projemize bu şekilde ASP desteğini eklemiş olduk. Şimdi sıra geldi kodlarımızı kişiselleştirmeye. Bu aşamada istersek kodları kendi dilimize bile çevirebiliriz. (Ben biraz denedim ama sanırım pek uymadı)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code9'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p109"><td class="code" id="p10code9"><pre class="asp" style="font-family:monospace;"><span style="color: #008000;">'Buradaki Türkçe isimler tamamen sizin inisiyatifinize kalmış.</span>
<span style="color: #990099; font-weight: bold;">Private</span> Baglam <span style="color: #330066;">As</span> ScriptingContext
<span style="color: #990099; font-weight: bold;">Private</span> Uygulama <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Application</span>
<span style="color: #990099; font-weight: bold;">Private</span> Istek <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Request</span>
<span style="color: #990099; font-weight: bold;">Private</span> Cevap <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Response</span>
<span style="color: #990099; font-weight: bold;">Private</span> Sunucu <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Server</span>
<span style="color: #990099; font-weight: bold;">Private</span> Oturum <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Session</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> OnStartPage<span style="color: #006600; font-weight:bold;">&#40;</span>PassedScriptingContext <span style="color: #330066;">As</span> ScriptingContext<span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Baglam <span style="color: #006600; font-weight: bold;">=</span> PassedScriptingContext
    <span style="color: #990099; font-weight: bold;">Set</span> Uygulama <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Application</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Istek <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Request</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Cevap <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Response</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Sunucu <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Server</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Oturum <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Session</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> OnEndPage<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Baglam <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Uygulama <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Istek <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Cevap <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Sunucu <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Oturum <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span></pre></td></tr></table></div>

<p>Kodlarımızı yazdıktan sonra projemize ve sınıfımıza birer isim verelim. Bu kısım önemlidir çünkü örnek sayfamızı çalıştırdığımızda oluşturduğumuz bu DLL dosyasını kullanabilmek için nesne oluştururken bu isimler kullanılır (<strong>ProjeAdı.SınıfAdı</strong>). Bu yazımda ben proje adımı &#8220;<strong>ASPden</strong>&#8220;, sınıf adımı ise &#8220;<strong>DLLye</strong>&#8221; olarak belirledim. Bunların ne olacağı tamamen size kalmış. Önce projemize bir isim verelim ve tekrar Project menüsüne dönelim ve <strong>Project1 Properties</strong> menüsüne tıklayalım. (Eğer buraya gelmeden önce projenizin ismini değiştirdiyseniz sorun yok ama buna rağmen tekrar değiştirmek isterseniz bu menü &#8220;<strong><em>ProjenizinAdı</em> Properties</strong>&#8221; olarak görünür.)</p>
<p>Açılan pencereden <strong>Project Name</strong> kutucuğuna istediğimiz ismi yazıyoruz (Ben ASPden demiştim.) ve <strong>Tamam</strong>&#8216;a tıklıyoruz. Projemizin artık bir adı var. Şimdi sıra sınıfımızı adlandırmaya geldi. Bunun için çalışma sayfamıza geri dönüyoruz ve sağ tarafta <strong>Properties &#8211; Class1</strong> başlıklı pencereyi buluyoruz. (Eğer buraya gelmeden de sınıfınızın ismini değiştirdiyseniz ve yine de değiştirmek isterseniz bu pencerenin başlığı <strong>Properties &#8211; <em>Sınıfınızın Adı</em></strong> olarak görünecektir.) Eğer bu pencereyi göremiyorsanız <strong>View</strong> menüsünden <strong>Properties Window</strong> seçeneğini tıklayın veya direkt olarak <strong>F4</strong> tuşuna basın. Bu pencerede görüntülenen özelliklerden <strong>Name</strong> yazanın karşısına tıklayıp istediğimiz ismi yazalım. (Ben DLLye yazmıştım.) DLL dosyamız kısmen bitti ama işin en civcivli kısmına geldik: DLL dosyamıza kendi ASP kodlarımızı ekleyeceğiz.</p>
<p>Bunun için yazının başında hazırladığımız ASP dosyamızı açalım. Bir iki ufak değişiklikten sonra bu kodları az önce oluşturduğumuz kodlarla birleştirerek işlemimizi tamamlayacağız. Yukarıdaki kodlarda ASP&#8217;nin Response nesnesinin adını ben Cevap olarak değiştirmiştim. Bu nedenle ilk oluşturduğumuz ASP dosyamızdaki Response yazan yerleri Cevap olarak değiştireceğiz ve Deneme isimli bir fonksiyona ekleyeceğiz:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code10'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1010"><td class="code" id="p10code10"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> Deneme<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;ASP kodlarını DLL üzerinden çalıştırma denemesi&lt;/title&gt;&quot;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;/head&gt;&lt;body&gt;&lt;font color=&quot;</span><span style="color: #cc0000;">&quot;#FF0000&quot;</span><span style="color: #cc0000;">&quot; size=2 face=&quot;</span><span style="color: #cc0000;">&quot;trebuchet ms&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;Bu sayfa bir DLL dosyasından türetilmiştir.&lt;/font&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span></pre></td></tr></table></div>

<p>Son olarak kafalar karışmadan tüm kodları birleştirerek pişirmek için fırına verelim:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code11'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1011"><td class="code" id="p10code11"><pre class="asp" style="font-family:monospace;"><span style="color: #008000;">'Buradaki Türkçe isimler tamamen sizin inisiyatifinize kalmış.</span>
<span style="color: #990099; font-weight: bold;">Private</span> Baglam <span style="color: #330066;">As</span> ScriptingContext
<span style="color: #990099; font-weight: bold;">Private</span> Uygulama <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Application</span>
<span style="color: #990099; font-weight: bold;">Private</span> Istek <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Request</span>
<span style="color: #990099; font-weight: bold;">Private</span> Cevap <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Response</span>
<span style="color: #990099; font-weight: bold;">Private</span> Sunucu <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Server</span>
<span style="color: #990099; font-weight: bold;">Private</span> Oturum <span style="color: #330066;">As</span> <span style="color: #990099; font-weight: bold;">Session</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> OnStartPage<span style="color: #006600; font-weight:bold;">&#40;</span>PassedScriptingContext <span style="color: #330066;">As</span> ScriptingContext<span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Baglam <span style="color: #006600; font-weight: bold;">=</span> PassedScriptingContext
    <span style="color: #990099; font-weight: bold;">Set</span> Uygulama <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Application</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Istek <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Request</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Cevap <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Response</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Sunucu <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Server</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Oturum <span style="color: #006600; font-weight: bold;">=</span> Baglam.<span style="color: #990099; font-weight: bold;">Session</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> OnEndPage<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Baglam <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Uygulama <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Istek <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Cevap <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Sunucu <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">Set</span> Oturum <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Public</span> <span style="color: #0000ff; font-weight: bold;">Sub</span> Deneme<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;ASP kodlarını DLL üzerinden çalıştırma denemesi&lt;/title&gt;&quot;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;/head&gt;&lt;body&gt;&lt;font color=&quot;</span><span style="color: #cc0000;">&quot;#FF0000&quot;</span><span style="color: #cc0000;">&quot; size=2 face=&quot;</span><span style="color: #cc0000;">&quot;trebuchet ms&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span>
    Cevap.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;Bu sayfa bir DLL dosyasından türetilmiştir.&lt;/font&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #0000ff; font-weight: bold;">Sub</span></pre></td></tr></table></div>

<p>Kodlama kısmı bittiğine göre artık DLL dosyamızı oluşturabiliriz. Bunun için <strong>File</strong> menüsünden <strong>Make ASPden.dll</strong> menüsünü tıklıyoruz. (Eğer projemizi farklı isimlendirdiysek bu menü <strong>Make <em>Proje Adı.dll</em></strong> olarak görünecektir.) Ben kolaylık olsun diye projemi direkt olarak C: dizininin altında oluşturdum. Kaydedilen DLL dosyasının isminin hiçbir önemi olmadığı için istediğiniz ismi vererek projenizi derleyebilirsiniz (Yine ben Sniper adıyla derledim). DLL dosyamızı oluşturduğumuza göre bunu sistemimize tanıtmanın zamanı geldi. <strong>Başlat</strong> menüsünden <strong>Çalıştır</strong>&#8216;ı seçiyoruz ve açılan pencereye<strong> regsvr32 C:\Sniper.dll</strong> yazıp Enter tuşuna basıyoruz. Eğer karşımıza &#8220;<strong>DllRegisterServer / C:\Sniper.dll başarıyla gerçekleştirildi.</strong>&#8221; mesajı gelmediyse bir yerlerde hata yapmış olasılığımız üzerine yazıyı en baştan tekrar okuyoruz. (İnşallah yazım hatası yapmamışımdır da sürekli aynı yeri okumak zorunda kalmazsınız)</p>
<p>Tüm işlemlerimizi tamamladık. Artık derlediğimiz dosyamızı deneyelim değil mi? Eğer yukarıdaki kodları aynen kullandıysanız aşağıdakini de aynen kopyalayıp <strong>C:\inetpub\wwwroot</strong> klasörüne &#8220;<strong>asp2dll.asp</strong>&#8221; ismiyle kaydedin ve sonucu görmek için browser&#8217;ınızın adres kısmına <strong>http://localhost/asp2dll.asp</strong> yazın:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code12'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1012"><td class="code" id="p10code12"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #990099; font-weight: bold;">Set</span> Ornek <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ASPden.DLLye&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
Ornek.<span style="color: #9900cc;">Deneme</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

<p>Eğer aşağıdaki görüntüyü aldıysanız kendinizi kutlayın.</p>
<p><img src="http://kinali.net/wp-content/uploads/2009/03/sonuc.jpg" alt="sonuc" title="sonuc" width="432" height="240" class="aligncenter size-full wp-image-51" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tuncay.kinali.net/asp-dosyalarinizi-dlle-cevirin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP ile MS Access verilerini sayfalama</title>
		<link>http://tuncay.kinali.net/asp-ile-ms-access-verilerini-sayfalama.html</link>
		<comments>http://tuncay.kinali.net/asp-ile-ms-access-verilerini-sayfalama.html#comments</comments>
		<pubDate>Tue, 10 Mar 2009 18:23:10 +0000</pubDate>
		<dc:creator>Sniper</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[msaccess]]></category>
		<category><![CDATA[sayfalama]]></category>

		<guid isPermaLink="false">http://kinali.net/?p=8</guid>
		<description><![CDATA[MS Access veritabanından gelen verileri sayfalamak, MySQL veritabanına oranla çok daha basittir. Bu basitliğin nedeni Recordset nesnesi tarafından desteklenmesinden kaynaklanmaktadır. Bu yazımda sizlere MS Access vertabanından gelen verileri, Recordset nesnesini kullanarak sayfalama konusundan bahsedeceğim. Aşağıdaki kodlardan faydalanmak için sniper.mdb.zip dosyasını indirip kodlarla aynı dizine eklemeniz gerekmektedir. Lafı fazla uzatmadan hemen kodlara giriyorum.

Öncelikle her zaman olduğu [...]]]></description>
			<content:encoded><![CDATA[<p>MS Access veritabanından gelen verileri sayfalamak, MySQL veritabanına oranla çok daha basittir. Bu basitliğin nedeni Recordset nesnesi tarafından desteklenmesinden kaynaklanmaktadır. Bu yazımda sizlere MS Access vertabanından gelen verileri, Recordset nesnesini kullanarak sayfalama konusundan bahsedeceğim. Aşağıdaki kodlardan faydalanmak için sniper.mdb.zip dosyasını indirip kodlarla aynı dizine eklemeniz gerekmektedir. Lafı fazla uzatmadan hemen kodlara giriyorum.<br />
<span id="more-8"></span><br />
Öncelikle her zaman olduğu gibi değişkenlerimizi tanımlıyoruz, bağlantı ve Recordset nesnemizi açarak sayfalamak istediğimiz verilerimizi çekiyoruz:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code18'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p818"><td class="code" id="p8code18"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Option</span> <span style="color: #990099; font-weight: bold;">Explicit</span>
<span style="color: #990099; font-weight: bold;">Dim</span> Bag, Rs, i, s, Sayfa, SQL
&nbsp;
<span style="color: #990099; font-weight: bold;">Set</span> Bag <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Connection&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">Set</span> Rs <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Recordset&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
Bag.<span style="color: #330066;">Open</span> <span style="color: #cc0000;">&quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">MapPath</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;sniper.mdb&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
SQL <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;SELECT * FROM tblSiteler&quot;</span>
Rs.<span style="color: #330066;">Open</span> SQL, Bag, <span style="color: #800000;">1</span>, <span style="color: #800000;">3</span></pre></td></tr></table></div>

<p>Bağlantımızı açtıktan sonra kayıt setimizden veri dönüp dönmediğini kontrol etmeliyiz. Bu sayfalama kodunda kullanacağımız Recordset nesnesinin AbsolutePage özelliğinin hata vermemesi için önemlidir. AbsolutePage özelliği, kayıtsetine hangi sayfada olduğumuzu söyleyen kontrolümüzdür. Kontrolümüzü yaptıktan sonra nesnemizin PageSize özelliğiyle bir sayfada görüntülenecek kayıt sayısını belirleyip tablomuzu sayfamıza çizdiriyoruz.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code19'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p819"><td class="code" id="p8code19"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Not</span> Rs.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #990099; font-weight: bold;">Then</span>
  <span style="color: #008000;">'Bir sayfada gösterilecek kayıt sayısını belirliyoruz</span>
  Rs.<span style="color: #9900cc;">PageSize</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">2</span>
&nbsp;
  <span style="color: #008000;">'Eğer QueryString'de sayfa değişkeni tanımlanmışsa</span>
  <span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&lt;&gt;</span> <span style="color: #cc0000;">&quot;&quot;</span> <span style="color: #990099; font-weight: bold;">Then</span>
    <span style="color: #008000;">'Bulunduğumuz sayfayı bu değişkenin değeri olarak atayalım</span>
    Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #9900cc;">QueryString</span><span style="color: #006600; font-weight: bold;">&lt;</span> font<span style="color: #006600; font-weight: bold;">&gt;</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
  <span style="color: #990099; font-weight: bold;">Else</span>
    <span style="color: #008000;">'Değilse başlangıç sayfa numaramızı 1 olarak atayalım</span>
    Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">1</span>
  <span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
  <span style="color: #008000;">' ve Kayıtsetimize hangi sayfada bulunduğumuzu söyleyelim.</span>
  Rs.<span style="color: #9900cc;">AbsolutePage</span> <span style="color: #006600; font-weight: bold;">=</span> Sayfa
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>table border<span style="color: #cc0000;">&quot;1&quot;</span> bordercolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#C0C0C0&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;border-collapse:collapse; font:normal normal normal 11px verdana;&quot;</span> width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;500&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;5&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>S<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;245&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>Site Adı<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;250&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>URL
<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>table<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Şimdi elimizdekileri verileri, bir sayfada gösterilecek kayıt sayısınca sayfamıza bastıracak olan döngümüzü yazıyoruz:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code20'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p820"><td class="code" id="p8code20"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">0</span>
  <span style="color: #008000;">'Kayıtsetimizi bir sayfada gösterilecek kayıt sayısı adedince döndürelim.</span>
&nbsp;
  <span style="color: #990099; font-weight: bold;">Do</span> <span style="color: #990099; font-weight: bold;">While</span> <span style="color: #990099; font-weight: bold;">Not</span> Rs.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #0000ff; font-weight: bold;">And</span> i<span style="color: #006600; font-weight: bold;">&lt;</span>Rs.<span style="color: #9900cc;">PageSize</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;center&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>i+<span style="color: #800000;">1</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Rs<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldSiteAdi&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>a href<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;&lt;%=Rs(&quot;</span>fldURL<span style="color: #cc0000;">&quot;)%&gt;&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span> target<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;_blank&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Rs<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldURL&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>a<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  i<span style="color: #006600; font-weight: bold;">=</span>i+<span style="color: #800000;">1</span>
  Rs.<span style="color: #330066;">MoveNext</span>
<span style="color: #990099; font-weight: bold;">Loop</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

<p>Veriler istediğimiz sayıda sayfaya yazıldı. Şimdi sıra sayfa numaralarını linklendirmeye geldi:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code21'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p821"><td class="code" id="p8code21"><pre class="asp" style="font-family:monospace;">  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td colspan<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;3&quot;</span> align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;right&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  <span style="color: #008000;">' ve son olarak ta sayfaların linklerini sayfamıza bastıralım.</span>
  <span style="color: #990099; font-weight: bold;">If</span> Rs.<span style="color: #9900cc;">PageCount</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span> <span style="color: #990099; font-weight: bold;">Then</span>
    <span style="color: #990099; font-weight: bold;">For</span> s<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">To</span> Rs.<span style="color: #9900cc;">PageCount</span>
      <span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;a href=&quot;</span><span style="color: #cc0000;">&quot;?s=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> s <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> s <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&lt;/a&gt; &quot;</span>
    <span style="color: #990099; font-weight: bold;">Next</span>
  <span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  <span style="color: #008000;">' Bitti, hayırlı olsun...</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

<p>Ms Access ile sayfalama işlemi bu kadar basit. Kaliteli sitelerde kullanmanız dileğinde bulunduktan sonra yazımı kodların tamamıyla kapatıyorum&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p8code22'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p822"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
</pre></td><td class="code" id="p8code22"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #990099; font-weight: bold;">Option</span> <span style="color: #990099; font-weight: bold;">Explicit</span>
<span style="color: #990099; font-weight: bold;">Dim</span> Bag, Rs, i, s, Sayfa, SQL
&nbsp;
<span style="color: #990099; font-weight: bold;">Set</span> Bag <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Connection&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">Set</span> Rs <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Recordset&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
Bag.<span style="color: #330066;">Open</span> <span style="color: #cc0000;">&quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">MapPath</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;sniper.mdb&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
SQL <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;SELECT * FROM tblSiteler&quot;</span>
Rs.<span style="color: #330066;">Open</span> SQL, Bag, <span style="color: #800000;">1</span>, <span style="color: #800000;">3</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Not</span> Rs.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #990099; font-weight: bold;">Then</span>
&nbsp;
<span style="color: #008000;">'Bir sayfada gösterilecek kayıt sayısını belirliyoruz   Rs.</span>
PageSize <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">2</span>
&nbsp;
<span style="color: #008000;">'Eğer QueryString'de sayfa değişkeni tanımlanmışsa  </span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&lt;&gt;</span> <span style="color: #cc0000;">&quot;&quot;</span> <span style="color: #990099; font-weight: bold;">Then</span>    
<span style="color: #008000;">'Bulunduğumuz sayfayı bu değişkenin değeri olarak atayalım     Sayfa =</span>
<span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #9900cc;">QueryString</span><span style="color: #006600; font-weight: bold;">&lt;</span> font<span style="color: #006600; font-weight: bold;">&gt;</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>  
<span style="color: #990099; font-weight: bold;">Else</span>    
<span style="color: #008000;">'Değilse başlangıç sayfa numaramızı 1 olarak atayalım     Sayfa = 1</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
<span style="color: #008000;">' ve Kayıtsetimize hangi sayfada bulunduğumuzu söyleyelim.   Rs.</span>
AbsolutePage <span style="color: #006600; font-weight: bold;">=</span> Sayfa
<span style="color: #000000; font-weight: bold;">%&gt;</span> <span style="color: #006600; font-weight: bold;">&lt;</span>table border<span style="color: #cc0000;">&quot;1&quot;</span> bordercolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#C0C0C0&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;border-collapse:collapse; font:normal normal normal 11px verdana;&quot;</span> width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;500&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;5&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>S<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;&gt;</span>   <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;245&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>Site Adı<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;250&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>URL
<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">0</span>
<span style="color: #008000;">'Kayıtsetimizi bir sayfada gösterilecek kayıt sayısı adedince döndürelim.</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">Do</span> <span style="color: #990099; font-weight: bold;">While</span> <span style="color: #990099; font-weight: bold;">Not</span> Rs.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #0000ff; font-weight: bold;">And</span> i<span style="color: #006600; font-weight: bold;">&lt;</span>Rs.<span style="color: #9900cc;">PageSize</span> <span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;center&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>i+<span style="color: #800000;">1</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>   <span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Rs<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldSiteAdi&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>a href<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;&lt;%=Rs(&quot;</span>fldURL<span style="color: #cc0000;">&quot;)%&gt;&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span> target<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;_blank&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Rs<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldURL&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>a<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
i<span style="color: #006600; font-weight: bold;">=</span>i+<span style="color: #800000;">1</span>
Rs.<span style="color: #330066;">MoveNext</span>
<span style="color: #990099; font-weight: bold;">Loop</span> <span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td colspan<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;3&quot;</span> align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;right&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">' ve son olarak ta sayfaların linklerini sayfamıza bastıralım.</span>
<span style="color: #990099; font-weight: bold;">If</span> Rs.<span style="color: #9900cc;">PageCount</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span> <span style="color: #990099; font-weight: bold;">Then</span>
<span style="color: #990099; font-weight: bold;">For</span> s<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">To</span> Rs.<span style="color: #9900cc;">PageCount</span>
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;a href=&quot;</span><span style="color: #cc0000;">&quot;?s=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> s <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> s <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&lt;/a&gt; &quot;</span>
<span style="color: #990099; font-weight: bold;">Next</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>table<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">' Bitti, hayırlı olsun...</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tuncay.kinali.net/asp-ile-ms-access-verilerini-sayfalama.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP ile MySQL verilerini sayfalama</title>
		<link>http://tuncay.kinali.net/asp-ile-mysql-verilerini-sayfalama.html</link>
		<comments>http://tuncay.kinali.net/asp-ile-mysql-verilerini-sayfalama.html#comments</comments>
		<pubDate>Tue, 10 Mar 2009 18:22:30 +0000</pubDate>
		<dc:creator>Sniper</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[sayfalama]]></category>

		<guid isPermaLink="false">http://kinali.net/?p=6</guid>
		<description><![CDATA[ASP veya diğer programlama dilleriyle çalışmaya yeni başlayanların sıklıkla karşılaştıkları bir sorundur veri sayfalama. Veritabanına bağlantı kurulur ilk önce. Bu web programlamaya başlangıç için en önemli adım sayılır çoğumuzun gözünde. Daha sonra bağlanılan veritabanından verileri çekip sayfaya bastırılır. Bundan sonra, artık kendimizi web programcısı olarak görmeye başlarız. Zaman ilerledikçe veritabanına eklediğimiz veriler çoğalır, çoğalır&#8230; Artık [...]]]></description>
			<content:encoded><![CDATA[<p>ASP veya diğer programlama dilleriyle çalışmaya yeni başlayanların sıklıkla karşılaştıkları bir sorundur veri sayfalama. Veritabanına bağlantı kurulur ilk önce. Bu web programlamaya başlangıç için en önemli adım sayılır çoğumuzun gözünde. Daha sonra bağlanılan veritabanından verileri çekip sayfaya bastırılır. Bundan sonra, artık kendimizi web programcısı olarak görmeye başlarız. Zaman ilerledikçe veritabanına eklediğimiz veriler çoğalır, çoğalır&#8230; Artık yeni bir sıkıntı peyda olmak üzeredir. VERİ SAYFALAMA! Bu sıkıntıyı gidermek için yazımda sizlere MySQL veritabanındaki verileri, istediğimiz sayıda kayıtlara bölerek sitelerimizde nasıl kullanacağımızı bildiğim kadarıyla anlatacağım. Yazımda yer alan kodların düzgün çalışabilmesi için sniper.zip dosyasını indirip MySQL´e veritabanı olarak eklemeniz gerekmektedir.<br />
<span id="more-6"></span></p>
<p>İşe değişkenlerimizi tanımlayarak başlayalım:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code31'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p631"><td class="code" id="p6code31"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Dim</span> Bag, Siteler, SQLTop, TopKayit
<span style="color: #990099; font-weight: bold;">Dim</span> KayitSayisi, SayfaSayisi, Sayfa, i</pre></td></tr></table></div>

<p><strong>Bag</strong> = Veritabanımıza bağlantımızı sağlayacak değişken.<br />
<strong>Siteler</strong> = Kayıtseti değişkeni.<br />
<strong>TopKayit</strong> = Talep edeceğimiz kriterlere uyan kayıtların toplam sayısını tutan değişken.<br />
<strong>KayitSayisi</strong> = Bir sayfada gösterilecek kayıt sayısını belirleyeceğimiz değişken.<br />
<strong>SayfaSayisi</strong> = Talep ettiğimiz verilere ve kayıt sayısına göre toplam kaç sayfa veri oluşacağını tutan değişken.<br />
<strong>Sayfa</strong> = O anda içinde bulunduğumuz sayfanın numarasını öğreneceğimiz değişken.<br />
<strong>i</strong> = HTML tablomuzda kayıtların sıra sayılarını yazdıracağımız değişken.</p>
<p>Değişkenlerimizi tanımladıktan sonra sıra geldi bağlantımızı oluşturmaya:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code32'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p632"><td class="code" id="p6code32"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Set</span> Bag <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Connection&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
Bag.<span style="color: #330066;">Open</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;DRIVER={MySQL ODBC 3.51 Driver};database=sniper;server=localhost;uid=sniper;password=tuncay;&quot;</span></pre></td></tr></table></div>

<p>Bağlantı string´imizin parametrelerinin alacağı değerler kısaca şöyledir:<br />
<strong>database</strong> = Bağlantı kuracağımız MySQL veritabanımızın adı.<br />
<strong>server</strong> = Bağlantı kuracağımız MySQL veritabanımızın bulunduğu server.<br />
<strong>uid</strong> = Veritabanına ulaşmak için gerekli kullanıcı adı.<br />
<strong>password</strong> = Kullanıcı adına ait şifre.</p>
<p>Bağlantımızı kurduktan sonra, bir sayfada kaç adet kaydın gösterileceğini KayitSayisi isimli değişkenimizde belirtiyoruz ve hangi sayfada olduğumuzu Sayfa değişkenine atıyoruz:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code33'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p633"><td class="code" id="p6code33"><pre class="asp" style="font-family:monospace;">KayitSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">2</span>
&nbsp;
<span style="color: #008000;">'Eğer QueryString´de sayfa değişkeni tanımlanmışsa</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&lt;&gt;</span> <span style="color: #cc0000;">&quot;&quot;</span> <span style="color: #990099; font-weight: bold;">Then</span>
  <span style="color: #008000;">'Bulunduğumuz sayfayı bu değişkenin değeri olarak atayalım</span>
  Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">Else</span>
  <span style="color: #008000;">'Değilse başlangıç sayfa numaramızı 1 olarak atayalım</span>
  Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">1</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span></pre></td></tr></table></div>

<p>Önemli değişkenlerimizi de tanımladığımıza göre artık kayıt setimizi oluşturabiliriz. Kayıt setimizi oluşturmadan önce MySQL´de var olan bir kalıptan da kısaca bahsetmek istiyorum: LIMIT. Bu kalıp bize, sorgumuzda dönen kayıtlarından istediğimiz aralıktaki verileri süzerek dönmesini sağlar. Şöyle ki, LIMIT 5,10 şeklinde bir kullanım bize, istediğimiz sorguda dönen verilerin beşincisinden başlayarak 10 tanesinin iletilmesini sağlar. İkinci parametre kullanılmazsa (LIMIT 10 gibi) verilerin sadece ilk 10 tanesi geri döner. Bu da Access sorgularımızda kullandığımız TOP 10 a eşittir. Biz bu kalıbı kullanarak verilerimizi rahatlıkla sayfalayabileceğiz. Şimdi bu kalıbı da kullanarak kayıt setimizi açalım:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code34'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p634"><td class="code" id="p6code34"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Set</span> Siteler <span style="color: #006600; font-weight: bold;">=</span> Bag.<span style="color: #330066;">Execute</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;SELECT * FROM tblSiteler ORDER BY fldID DESC LIMIT &quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight: bold;">*</span>Sayfa<span style="color: #006600; font-weight:bold;">&#41;</span>-<span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;,&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Yukarıdaki SQL sorgumuz, KayitSayisi değişkeninin değerini &#8220;2&#8243;, Sayfa değişkeninin değerini de &#8220;3&#8243; olarak kabul ettiğimizde aşağıdaki şekilde çıktı verdiğini kabul edebiliriz:</p>
<p><strong>&#8220;SELECT * FROM tblSiteler ORDER BY fldID DESC LIMIT 4, 2&#8243;</strong></p>
<p>Bu da bize 4. kayıttan itibaren 2 kaydın döndürülmesini istediğimiz anlamına gelmektedir. Kayıt setimizden gerekli kayıtları aldıktan sonra sayfalama linklerini yazdırabilmemiz için gerekli olan, sorgumuza eşit toplam kaç kayıt olduğunu öğrenmeliyiz:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code35'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p635"><td class="code" id="p6code35"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">Set</span> SQLTop <span style="color: #006600; font-weight: bold;">=</span> Bag.<span style="color: #330066;">Execute</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;SELECT COUNT(fldID) FROM tblSiteler&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
TopKayit <span style="color: #006600; font-weight: bold;">=</span> SQLTop<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">0</span><span style="color: #006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Verilerimizi sayfamıza yazdırmamız için gerekli tüm hazırlıkları tamamladık. Artık yazdırmaya başlayalım:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code36'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p636"><td class="code" id="p6code36"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Not</span> Siteler.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #990099; font-weight: bold;">Then</span>
&nbsp;
  <span style="color: #008000;">'HTML tablomuzu oluşturuyoruz.</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>table border<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;1&quot;</span> bordercolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#C0C0C0&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;border-collapse:collapse; font:normal normal normal 11px verdana;&quot;</span> width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;500&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;5&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>S<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;245&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>Site Adı<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;250&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>URL<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  <span style="color: #008000;">'Tablodaki sıra numarasını belirlemek için değişkenimizi tanımlıyoruz</span>
  i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span>
&nbsp;
  <span style="color: #008000;">'Talep ettiğimiz kayıtların sonuna kadar...</span>
  <span style="color: #990099; font-weight: bold;">Do</span> <span style="color: #990099; font-weight: bold;">While</span> <span style="color: #990099; font-weight: bold;">Not</span> Siteler.<span style="color: #0000ff; font-weight: bold;">EOF</span>
&nbsp;
    <span style="color: #008000;">'... tüm kayıtları sayfamıza bastırıyoruz</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;center&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>i<span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Siteler<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldSiteAdi&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>a href<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;&lt;%=Siteler(&quot;</span>fldURL<span style="color: #cc0000;">&quot;)%&gt;&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span> target<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;_blank&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Siteler<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldURL&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>a<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
    <span style="color: #008000;">'Sıra numarasını 1 arttırıyoruz</span>
    i<span style="color: #006600; font-weight: bold;">=</span>i+<span style="color: #800000;">1</span>
&nbsp;
    <span style="color: #008000;">'Kayıtsetimize sonraki kayda geçmesini söylüyoruz</span>
    Siteler.<span style="color: #330066;">MoveNext</span>
&nbsp;
    <span style="color: #008000;">'Yukarıdaki işlemin, verilerin sonuncusuna gelene kadar devam etmesi için döngümüzü çeviriyoruz</span>
<span style="color: #990099; font-weight: bold;">Loop</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>table<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Verilerimizi yazdırdıktan sonra sıra geldi sayfa numaralarını yazdırmaya:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code37'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p637"><td class="code" id="p6code37"><pre class="asp" style="font-family:monospace;">  <span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;</span>td colspan<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;3&quot;</span> align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;right&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
  <span style="color: #008000;">'Toplam kayıt sayısı gösterilecek kayıt sayısından büyükse...</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>TopKayit<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #990099; font-weight: bold;">Then</span>
  <span style="color: #008000;">'Link verilecek kaç sayfamız olduğunu hesaplıyoruz</span>
  SayfaSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>TopKayit<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">/</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span>
  <span style="color: #990099; font-weight: bold;">If</span> <span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">1</span>,SayfaSayisi,<span style="color: #cc0000;">&quot;,&quot;</span>,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span> <span style="color: #990099; font-weight: bold;">Then</span> SayfaSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>Left<span style="color: #006600; font-weight:bold;">&#40;</span>SayfaSayisi,<span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">1</span>,SayfaSayisi,<span style="color: #cc0000;">&quot;,&quot;</span>,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span> + <span style="color: #800000;">1</span>
&nbsp;
  <span style="color: #008000;">'Ve yine elimizdeki sayfa sayısı 1´den büyükse</span>
  <span style="color: #990099; font-weight: bold;">If</span> SayfaSayisi <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">Then</span>
    <span style="color: #008000;">'Her sayfa numarası için sayfamıza linkimizi yazdırıyoruz</span>
    <span style="color: #990099; font-weight: bold;">For</span> i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">To</span> SayfaSayisi
      <span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;a href=&quot;</span><span style="color: #cc0000;">&quot;?s=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> i <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&quot;</span><span style="color: #cc0000;">&quot; style=&quot;</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> i <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&lt;/a&gt; &quot;</span>
    <span style="color: #990099; font-weight: bold;">Next</span>
  <span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
  <span style="color: #008000;">'Sayfa numarası yazdırma işlemi bitti...</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
  <span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Ve final! Artık tablomuzdaki veriler, sayfalara ayrılmış ve linkleri oluşturulmuş bir şekilde HTML sayfamıza basıldı. Son olarak kodların tamamını yazdıktan sonra yazımı bitiriyorum. Kaliteli sitelerde kullanmanız dileğiyle&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code38'); return false;">View Code</a> ASP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p638"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</pre></td><td class="code" id="p6code38"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">'Her iyi programcı değişken tanımlarmış, ben ilk defa yapıyorum :)</span>
<span style="color: #990099; font-weight: bold;">Dim</span> Bag, Siteler, SQLTop, TopKayit
<span style="color: #990099; font-weight: bold;">Dim</span> KayitSayisi, SayfaSayisi, Sayfa, i
&nbsp;
<span style="color: #008000;">'Bağlantımızı oluşturup açıyoruz</span>
<span style="color: #990099; font-weight: bold;">Set</span> Bag <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;ADODB.Connection&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
Bag.<span style="color: #330066;">Open</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;DRIVER={MySQL ODBC 3.51 Driver};database=sniper;server=localhost;uid=sniper;password=tuncay;&quot;</span>
&nbsp;
<span style="color: #008000;">'Bir sayfada gösterilecek kayıt sayısı</span>
KayitSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">2</span>
&nbsp;
<span style="color: #008000;">'Eğer QueryString´de sayfa değişkeni tanımlanmışsa</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&lt;&gt;</span> <span style="color: #cc0000;">&quot;&quot;</span> <span style="color: #990099; font-weight: bold;">Then</span>
<span style="color: #008000;">'Bulunduğumuz sayfayı bu değişkenin değeri olarak atayalım</span>
Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #990099; font-weight: bold;">Request</span>.<span style="color: #330066;">QueryString</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;s&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">Else</span>
<span style="color: #008000;">'Değilse başlangıç sayfa numaramızı 1 olarak atayalım</span>
Sayfa <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">1</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
<span style="color: #008000;">'Kayıt sayımız ve sayfa numaramıza göre veritabanından verilerimizi talep ediyoruz</span>
<span style="color: #990099; font-weight: bold;">Set</span> Siteler <span style="color: #006600; font-weight: bold;">=</span> Bag.<span style="color: #330066;">Execute</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;SELECT * FROM tblSiteler ORDER BY fldID DESC LIMIT &quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight: bold;">*</span>Sayfa<span style="color: #006600; font-weight:bold;">&#41;</span>-<span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;,&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color: #008000;">'Veritabanında kriterlerimize uygun kayıtların toplam sayısını alıyoruz</span>
<span style="color: #008000;">'Bu sayfa numaralarını doğru yazdırabilmemiz için şart</span>
<span style="color: #990099; font-weight: bold;">Set</span> SQLTop <span style="color: #006600; font-weight: bold;">=</span> Bag.<span style="color: #330066;">Execute</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;SELECT COUNT(fldID) FROM tblSiteler&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
TopKayit <span style="color: #006600; font-weight: bold;">=</span> SQLTop<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">0</span><span style="color: #006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color: #008000;">'Eğer veritabanımızdan kayıt dönüyorsa</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">Not</span> Siteler.<span style="color: #0000ff; font-weight: bold;">EOF</span> <span style="color: #990099; font-weight: bold;">Then</span>
&nbsp;
<span style="color: #008000;">'HTML tablomuzu oluşturuyoruz.</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>table border<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;1&quot;</span> bordercolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#C0C0C0&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;border-collapse:collapse; font:normal normal normal 11px verdana;&quot;</span> width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;500&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;5&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>S<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;245&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>Site Adı<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td width<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;250&quot;</span> bgcolor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#FFFBDF&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;</span>URL<span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">'Tablodaki sıra numarasını belirlemek için değişkenimizi tanımlıyoruz</span>
i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span>
&nbsp;
<span style="color: #008000;">'Talep ettiğimiz kayıtların sonuna kadar...</span>
<span style="color: #990099; font-weight: bold;">Do</span> <span style="color: #990099; font-weight: bold;">While</span> <span style="color: #990099; font-weight: bold;">Not</span> Siteler.<span style="color: #0000ff; font-weight: bold;">EOF</span>
&nbsp;
<span style="color: #008000;">'... tüm kayıtları sayfamıza bastırıyoruz</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;center&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>i<span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Siteler<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldSiteAdi&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>b<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td<span style="color: #006600; font-weight: bold;">&gt;&lt;</span>a href<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;&lt;%=Siteler(&quot;</span>fldURL<span style="color: #cc0000;">&quot;)%&gt;&quot;</span> style<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span> target<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;_blank&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;</span> <span style="color: #006600; font-weight: bold;">%=</span>Siteler<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;fldURL&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span><span style="color: #006600; font-weight: bold;">&lt;/</span>a<span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">'Sıra numarasını 1 arttırıyoruz</span>
i<span style="color: #006600; font-weight: bold;">=</span>i+<span style="color: #800000;">1</span>
&nbsp;
<span style="color: #008000;">'Kayıtsetimize sonraki kayda geçmesini söylüyoruz</span>
Siteler.<span style="color: #330066;">MoveNext</span>
&nbsp;
<span style="color: #008000;">'Yukarıdaki işlemin, verilerin sonuncusuna gelene kadar devam etmesi için döngümüzü çeviriyoruz</span>
<span style="color: #990099; font-weight: bold;">Loop</span>
&nbsp;
<span style="color: #008000;">'Şimdi sayfa sayımız 1'den fazlaysa sayfa sayılarımızı yazdırıyoruz</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>td colspan<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;3&quot;</span> align<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;right&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">'Toplam kayıt sayısı gösterilecek kayıt sayısından büyükse...</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>TopKayit<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #990099; font-weight: bold;">Then</span>
<span style="color: #008000;">'Link verilecek kaç sayfamız olduğunu hesaplıyoruz</span>
SayfaSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>TopKayit<span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">/</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>KayitSayisi<span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #990099; font-weight: bold;">If</span> <span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">1</span>,SayfaSayisi,<span style="color: #cc0000;">&quot;,&quot;</span>,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">0</span> <span style="color: #990099; font-weight: bold;">Then</span> SayfaSayisi <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">CInt</span><span style="color: #006600; font-weight:bold;">&#40;</span>Left<span style="color: #006600; font-weight:bold;">&#40;</span>SayfaSayisi,<span style="color: #330066;">InStr</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #800000;">1</span>,SayfaSayisi,<span style="color: #cc0000;">&quot;,&quot;</span>,<span style="color: #800000;">1</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span> + <span style="color: #800000;">1</span>
&nbsp;
<span style="color: #008000;">'Ve yine elimizdeki sayfa sayısı 1´den büyükse</span>
<span style="color: #990099; font-weight: bold;">If</span> SayfaSayisi <span style="color: #006600; font-weight: bold;">&gt;</span> <span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">Then</span>
<span style="color: #008000;">'Her sayfa numarası için sayfamıza linkimizi yazdırıyoruz</span>
<span style="color: #990099; font-weight: bold;">For</span> i<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">1</span> <span style="color: #990099; font-weight: bold;">To</span> SayfaSayisi
<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">&quot;&lt;a href=&quot;</span><span style="color: #cc0000;">&quot;?s=&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> i <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&quot;</span><span style="color: #cc0000;">&quot; style=&quot;</span><span style="color: #cc0000;">&quot;color:#0000FF&quot;</span><span style="color: #cc0000;">&quot;&gt;&quot;</span> <span style="color: #006600; font-weight: bold;">&amp;</span> i <span style="color: #006600; font-weight: bold;">&amp;</span> <span style="color: #cc0000;">&quot;&lt;/a&gt; &quot;</span>
<span style="color: #990099; font-weight: bold;">Next</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
&nbsp;
<span style="color: #008000;">'Sayfa numarası yazdırma işlemi bitti...</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>td<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>tr<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>table<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span> <span style="color: #006600; font-weight: bold;">%</span>
<span style="color: #008000;">'Artık kodumuzu deneyebiliriz</span>
<span style="color: #990099; font-weight: bold;">End</span> <span style="color: #990099; font-weight: bold;">If</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://tuncay.kinali.net/asp-ile-mysql-verilerini-sayfalama.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTTP 500.100 hatalarına hükmedin</title>
		<link>http://tuncay.kinali.net/http-500-100-hatalarina-hukmedin.html</link>
		<comments>http://tuncay.kinali.net/http-500-100-hatalarina-hukmedin.html#comments</comments>
		<pubDate>Tue, 10 Mar 2009 14:50:17 +0000</pubDate>
		<dc:creator>Sniper</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[500.100]]></category>
		<category><![CDATA[hata sayfası]]></category>
		<category><![CDATA[http 500]]></category>

		<guid isPermaLink="false">http://kinali.net/?p=1</guid>
		<description><![CDATA[HTTP 500.100 iç sunucu hatalarını çoğumuz biliriz. Özellikle ASP ile programlamaya ilk başladığımız dönemlerde bu hata kodu beynimize adeta kazınmıştır. Bu hatalar, kodlarımızda herhangi bir sorun oluştuğunda almak istediğimiz çıktı yerine sunucumuzun bize o sevimsiz sayfayı döndürmesini sağlar. Bu yazıda, bu sevimsiz sayfanın sevimsizliğini gideremesekte kötünün en iyisi şekline sokmayı öğreneceğiz.

]]></description>
			<content:encoded><![CDATA[<p>HTTP 500.100 iç sunucu hatalarını çoğumuz biliriz. Özellikle ASP ile programlamaya ilk başladığımız dönemlerde bu hata kodu beynimize adeta kazınmıştır. Bu hatalar, kodlarımızda herhangi bir sorun oluştuğunda almak istediğimiz çıktı yerine sunucumuzun bize o sevimsiz sayfayı döndürmesini sağlar. Bu yazıda, bu sevimsiz sayfanın sevimsizliğini gideremesekte kötünün en iyisi şekline sokmayı öğreneceğiz.<span id="more-1"></span><br />
<!--pagetitle:Giriş--></p>
]]></content:encoded>
			<wfw:commentRss>http://tuncay.kinali.net/http-500-100-hatalarina-hukmedin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
