ugurnaz Posted June 7, 2009 Share Posted June 7, 2009 aspde içinden çıkılmaz ama bir o kadarda kolay bir kodu çözemez duruma geldim, sanırım sen aspde iyiydin sorum şu; veritabanım var vt1.mdb adında bunun içerisinde tablom var kalfa adında ve içerisinde 12 sütunlu bilgiler mevcut bu veritabanından adısoyadı ve tc kimlik no yazan sütuna ait bilgileri çekmek isityorum ama bir türlü beceremedim. tabi kullanıcı kişi tc kimlik no veya adısoaydı yazarak ara diye butona basacak ve ona ait kayıtlar ekrana gelecek... umarım anlatabilimişimdir. Link to comment Share on other sites More sharing options...
wmismail Posted June 7, 2009 Share Posted June 7, 2009 Öncelikle kısaca mantığına değinelim. Default.asp'de adam formu gönderecek. Diyelimki gonder.asp Burada senin yapacağın işlem nedir ? Öncelikle Boş kontrolü yaparsın. Şöyle ki : if request.form("isim") = "" thenresponse.redirect("hata.asp")end if[/CODE] [b]daha sonra veritabanında arama yaparsın. Ve o kayıdı seçersin.[/b] [CODE]<%set kd = server.createobject("adodb.recordset")sql="select * from tabloismi where tckimlik = "&request.form("tckimlik")&" and isim ="&request.form("isim")&""kd.open, sql, baglanti,1,3%>[/CODE] [b]Eğer kayıt yoksa hata verdir.[/b] [CODE]<%if kd.eof thenresponse.write("böyle bir kayıt yoktur")response.endend if%>[/CODE] [b]daha sonra ( kayıt bulundu ve seçildi ) bilgileri yazdırabilirsin. O satır seçildi. Aşağıdaki kodda xx koyduğum yere sütun isimlerinden herhangi birini yazarak kayıt çekebilirsin.[/b] [CODE]<%=kd("xxx")%>[/CODE] Not : Kodlar biras aceleye geldi. Kendine göre düzenle. Gördüğün hatalar olursa düzelt. Onun dışında hata ile karşılaşırsan yaz yardımcı olayım. Link to comment Share on other sites More sharing options...
mahoni Posted June 7, 2009 Share Posted June 7, 2009 onun asp ile alakası yok sql sorgunla alakalı select * from kalfa yerine select tckimlikno,adsoyad kalfa komutunu calıstırırsan sadece tckimlikno ve adsoyad kolonları gelir kalfa tablosundan. Link to comment Share on other sites More sharing options...
wmismail Posted June 7, 2009 Share Posted June 7, 2009 onun asp ile alakası yok sql sorgunla alakalıselect * from kalfa yerine select tckimlikno,adsoyad kalfa komutunu calıstırırsan sadece tckimlikno ve adsoyad kolonları gelir kalfa tablosundan. Ekrana neyle yazdırcak Link to comment Share on other sites More sharing options...
mahoni Posted June 7, 2009 Share Posted June 7, 2009 ben sandım sadece yazdırmada değil sadece o iki kolonu almada sıkıntısı var. o yüzden öyle yazdım. yani sorun o iki kolonu alıp kullanmaksa benim cevabım yetersiz. Link to comment Share on other sites More sharing options...
wmismail Posted June 7, 2009 Share Posted June 7, 2009 ben sandım sadece yazdırmada değil sadece o iki kolonu almada sıkıntısı var. o yüzden öyle yazdım. yani sorun o iki kolonu alıp kullanmaksa benim cevabım yetersiz. Cevabın soruya göre yetersiz ama aslında select * yerine tablo ismi kullanmak sistemi kasmayı biras daha önlüyor. Arkadaşın dediği gibi 12 sütun varsa benim yaptığın hepsini önbelleğe alıyor. select sütun1, sütun2 tarzı yapmak daha mantıklı. Ama hızlı kod yazarken veritabanını açıp tablo kontrolü yapmak zor oluyor.. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 7, 2009 Author Share Posted June 7, 2009 teşekkür ediyorum ancak ben sorumu tam anlatamadım daha basit hale getirip anlatacağım... kullanıcı default.asp de adı soyadı giriyor ve aramasını istiyor. <form action="ara.asp" Method="POST">Aranacak kelime: <input type="text" size="20" name="aranan" class="style2"><font face="Tahoma"> <input type="submit" value="Ara " class="style3"></form>[/CODE] daha sonra veritabanımın içindeki kalfa tablosundaki adısoyadı sütununda arama yapacak ve bulduğu satırdaki tüm bilgileri sütun adı ve değeri olarak alt alta yazacak. (öğrencinin 12 dersten aldığı notları; tabi ders isimleri sütunun adı) [CODE]aşağıdaki kod sütun isimlerini ve değerlerini yazıyor<% set baglanti=Server.CreateObject("ADODB.Connection") baglanti.Provider="Microsoft.Jet.OLEDB.4.0" baglanti.Open Server.Mappath("vt1.mdb") Set rs=Server.Createobject("adodb.recordset") rs.open "kalfa",baglanti Do While Not Rs.Eof for each i in rs.fields response.write i.name & ":" & i.value & "<br>" next Response.Write "<hr>": Rs.Movenext:Loop%>[/CODE] ama ikisini birleştiremedim... Link to comment Share on other sites More sharing options...
wmismail Posted June 7, 2009 Share Posted June 7, 2009 Sen sadece adı soyadı girilen kişinin değerlerini yazdırmıcak mısın ? Döngüye sokmaya gerek yok ki.. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 7, 2009 Author Share Posted June 7, 2009 Sen sadece adı soyadı girilen kişinin değerlerini yazdırmıcak mısın ? Döngüye sokmaya gerek yok ki.. evet adı soyadı yazan kişinin bilgilerini yazdıracağım ama sütun adlarını da yazdırmalıyım çünkü ders isimleri orada yazıyor Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 <% set baglanti=Server.CreateObject("ADODB.Connection") baglanti.Provider="Microsoft.Jet.OLEDB.4.0" baglanti.Open Server.Mappath("vt1.mdb") Set rs=Server.Createobject("adodb.recordset") rs.open "kalfa",baglanti,1,3 sql="select * from kalfa where adisoyadi = "&request.form("adisoyadi")&" " for each i in rs.fields response.write i.name & " :" & i.value & "<br>" next %>[/CODE] kodlarım böyle çıktısı ise [CODE]No :1tcno :1Mesleği :ALÜMİNYUM DOĞRAMACILIĞIadisoyadi :ŞİNASİ DEMİRTAŞ TÜRKÇE :Gi MATEMATİK VE MESLEK MATEMATİĞİ :Gi İŞLETME BİLGİSİ VE KOOPERATİF :Gi TOPLAM KALİTE YÖNETİMİ :Gi TEKNİK RESİM : İŞ GÜVENLİĞİ : MESLEK BİLGİSİ : MESLEK RESMİ : PRATİK UYGULAMA : MESLEKİ SAĞLIK BİLGİSİ : SERVİS BİLGİSİ : MÜŞTERİ İLİŞKİLERİ SATIŞ BİLGİ : EKONOMİ VE TİCARET BİLGİSİ : MUHASEBE : BİLGİ-İŞLEM : Durumu :Kaçıklma :KALDIAlan21 :Alan22 :[/CODE] şimdi sorun şu forma hangi değeri girersem gireyim yukarıdaki ekran çıktısı geliyor.(sadece 1. kayıtı listeliyor...) ben girdiğim değeri aramasını ve o kayıttaki bilgileri istiyorum nasıl yapacağız? Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 <% set baglanti=Server.CreateObject("ADODB.Connection") baglanti.Provider="Microsoft.Jet.OLEDB.4.0" baglanti.Open Server.Mappath("vt1.mdb") Set rs=Server.Createobject("adodb.recordset") sql="select * from kalfa where adisoyadi = "&request.form("adisoyadi")&" " rs.open sql,baglanti,1,3 for each i in rs.fields response.write i.name & " :" & i.value & "<br>" next %> Böyle dene. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 olmadı maalesef Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log . diye yanıt verdi. Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 <% set baglanti = server.createobject("adodb.connection") baglanti.open "provider=Microsoft.Jet.Oledb.4.0; Data Source=" & Server.Mappath("vt1.mdb") Set rs=Server.Createobject("adodb.recordset") sql="select * from kalfa where adisoyadi = "&request.form("adisoyadi")&" " rs.open sql,baglanti,1,3 for each i in rs.fields response.write i.name & " :" & i.value & "<br>" next %> Böyle dene bir de. Kendi alışkın olduğum şekilde değiştirdim bağlantıyı.. Bunu da dene bi. Hata veren satırı ver ona göre düzenleyelim. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 bu da olmadı maalesef Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.More information about this error may be available in the server error log.[/CODE] diye yanıt verdi. nerde hata aldığımı anlayamadım ama arama sonucu kayıtlarda kaçıncı olduğunu bulmak mı lazım i değerini ona göre mi yazmak lazım ? Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 Host üzerinden deniyorsan hata sayfalarını açar mısın. Hangi satırda olduğuna bakalım. Büyük ihtimalle döngüde hata veriyor. <%set baglanti = server.createobject("adodb.connection")baglanti.open "provider=Microsoft.Jet.Oledb.4.0; Data Source=" & Server.Mappath("vt1.mdb")Set rs=Server.Createobject("adodb.recordset")sql="select * from kalfa where adisoyadi = "&request.form("adisoyadi")&" "rs.open sql,baglanti,1,3%>[/CODE] şu bağlantıdan sonra alta şöyle bir değer çeksene. mesela ; [CODE]<%=rs("adisoyadi")%>[/CODE] eminim doğru kayıdı seçmiş olcak. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 offfff seni de meşgul etttim ama olmadı maalesef yukarıda yazdığım ekran geliyo başka da bir şey gelmiyo.... Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 O ekran hata sayfalarının kapalı olduğundan geliyor. Hata sayfalarını açalım önce ; Please register to see this content. Giriş yap. Web Hosting Service Domaini seç ( reseller kullanıyorsan ) Microsoft FrontPage support 1 bölümünü aktif et. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 zaten aktif görünüyor seçili yani Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 kapat öyleyse Link to comment Share on other sites More sharing options...
ugurnaz Posted June 8, 2009 Author Share Posted June 8, 2009 hiç bişey değişmedi gene aynı hatayı veriyor hata kodu veya satır vermiyo? Link to comment Share on other sites More sharing options...
wmismail Posted June 8, 2009 Share Posted June 8, 2009 :S Url'yi özelden atsana bi. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 10, 2009 Author Share Posted June 10, 2009 hepinize teşekkürler sonunda çözdüm... <form action="ara.asp" Method="POST">Aranacak kelime: <input type="text" size="20" name="adisoyadi" class="style2"><font face="Tahoma"> <input type="submit" value="Ara " class="style3"></form>[/CODE] [CODE]<%numr=request.form("adisoyadi")dim conn,rstResponse.Buffer=trueset conn = Server.CreateObject("ADODB.Connection")set rst = Server.CreateObject("ADODB.RecordSet")conn.Open "driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("vt1.mdb")sql = "SELECT * from kalfa WHERE adisoyadi='"&TRIM(numr)&"'"rst.open sql,conn,3,3if rst.eof=true thenresponse.redirect("yok.htm")end iffor each i in rst.fields response.write i.name & " ===>>>>> " & i.value & "<br>" next %> <B>ADI SOYADI:<FONT SIZE="3" COLOR="#3300CC"><%=rst("adisoyadi")%></FONT></B><br><br> <B>SONUÇ:<FONT SIZE="5" COLOR="#3300CC"><%=rst("açıklma")%></FONT></B>[/CODE] [CODE]sonuçNo ===>>>>> 21tcno ===>>>>> 21Mesleği ===>>>>> OTO MOTOR TAMİRCİLİĞİadisoyadi ===>>>>> ENGİN ÇETİNKAYA TÜRKÇE ===>>>>> MATEMATİK VE MESLEK MATEMATİĞİ ===>>>>> 2 İŞLETME BİLGİSİ VE KOOPERATİF ===>>>>> 2 TOPLAM KALİTE YÖNETİMİ ===>>>>> 2 TEKNİK RESİM ===>>>>> İŞ GÜVENLİĞİ ===>>>>> MESLEK BİLGİSİ ===>>>>> MESLEK RESMİ ===>>>>> PRATİK UYGULAMA ===>>>>> MESLEKİ SAĞLIK BİLGİSİ ===>>>>> SERVİS BİLGİSİ ===>>>>> MÜŞTERİ İLİŞKİLERİ SATIŞ BİLGİ ===>>>>> EKONOMİ VE TİCARET BİLGİSİ ===>>>>> MUHASEBE ===>>>>> BİLGİ-İŞLEM ===>>>>> Durumu ===>>>>> Gaçıklma ===>>>>> BELGEAlan21 ===>>>>> Alan22 ===>>>>> ADI SOYADI:ENGİN ÇETİNKAYASONUÇ:BELGE[/CODE] tekrar teşekkürler. Link to comment Share on other sites More sharing options...
ugurnaz Posted June 11, 2009 Author Share Posted June 11, 2009 bazı alanlarda bilgi bulunmuyor alan21 ve alan 22 de olduğu gibi(boş) bunları yazdırmamak için if then else gibi bir koşul kuramadım yardım edebilecek var mı? Link to comment Share on other sites More sharing options...
ugurnaz Posted June 12, 2009 Author Share Posted June 12, 2009 yok mu cevaplayacak kimse <%numr=request.form("adisoyadi")dim conn,rstResponse.Buffer=trueset conn = Server.CreateObject("ADODB.Connection")set rst = Server.CreateObject("ADODB.RecordSet")conn.Open "driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("vt1.mdb")sql = "SELECT * from kalfa WHERE adisoyadi='"&TRIM(numr)&"'"rst.open sql,conn,3,3if rst.eof=true thenresponse.redirect("yok.html")end iffor each i in rst.fields%> <table border="1" id="table1" cellspacing="1" bordercolor="#0000FF"><tr><%=if i.value<>Gi Then%><td width="350"><B><FONT SIZE="1" COLOR="#0000FF"><%=i.name%></td><td width="18"> </td><td width="180"><FONT SIZE="1" COLOR="#FF0000"> <%=i.value%></td></B><%=end if%></tr></table> <%next%>[/CODE] [CODE]Script error detected at line 32.Source line: Response.Write if i.value<>Gi ThenDescription: Sözdizimi hatası[/CODE] Link to comment Share on other sites More sharing options...
wmismail Posted June 12, 2009 Share Posted June 12, 2009 feild'ların tamamını çekiyorsun. Orda if kuramazsın sanırım. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.