Kod: Tümünü seç
<%
id = Request.Form("id")
R1 = Request.Form("R1")
yetiskin = Request.Form("yetiskin")
cocuk= Request.Form("cocuk")
bebek= Request.Form("bebek")
toplamadetimiz=yetiskin+cocuk+bebek
Vt_Pth=Server.Mappath("db.mdb")
Cumle= "DBQ="& Vt_Pth &";Driver={Microsoft Access Driver (*.mdb)}"
Set Baglanti=Server.CreateObject("Adodb.Connection")
Baglanti.Open Cumle
Set Rs=Server.CreateObject("Adodb.Recordset")
Sorgu="Select * from tablomuz WHERE id= "&id
rs.open Sorgu,baglanti,1,3
ucret1=rs("ucret1")
ucret2=rs("ucret2")
ucret3=rs("ucret3")
ucret4=rs("ucret4")
ucret5=rs("ucret5")
ucret6=rs("ucret6")
ucret7=rs("ucret7")
ucret8=rs("ucret8")
if R1 = ucret1 then
rs("adet1")=rs("adet1")-toplamadetimiz
else
if R1=ucret2 then
rs("adet2")=rs("adet2")-toplamadetimiz
else
if R1=ucret3 then
rs("adet3")=rs("adet3")-toplamadetimiz
else
if R1=ucret4 then
rs("adet4")=rs("adet4")-toplamadetimiz
else
if R1=ucret5 then
rs("adet5")=rs("adet5")-toplamadetimiz
else
if R1=ucret6 then
rs("adet6")=rs("adet6")-toplamadetimiz
else
if R1=ucret7 then
rs("adet7")=rs("adet7")-toplamadetimiz
else
if R1=ucret8 then
rs("adet8")=rs("adet8")-toplamadetimiz
end if
end if
end if
end if
end if
end if
end if
end if
RS.update
Rs.Close
Set Rs=Nothing
Baglanti.Close
Set Baglanti=Nothing
%>
örneğin R1 formunda 125 gelir ve veritabanındaki ucret1,ucret2...ucret8 alanlarından hangisi R1'e eşit olursa o koşulu sağlasın istiyorum.
Ayrıca herhangi bi hata almıyorum. Sayfa çalışıyo ama istediğim koşulu sağlayamıyorum.