

Vb 6.0 'Da Yazılan Stok Takip Programının Bir Bölümünün Yorumlanması Yardım
-
Başlıkta ne sorduğumu belirttim aşağıdaki kod bloğundaki bazı noktaları tam yorumlayamadım.yardımlarınızı bekliyorum.teşekkürler.
Private Sub Text1_LostFocus()
On Error Resume Next
If Text1.Text = "" Then
Command1.SetFocus
Else
Dim bul As New ADODB.Recordset
bul.Open "select * from urun where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
' "select * from urun where urun_no='" & Text1.Text & "'" bu sorgunun tam anlamını istiyorum
If bul("urun_adi") = "" Then 'burda nedemek istiyor aslında açık ama yukarıyla ilişkisi ne
aa = MsgBox("KAYIT BULUNAMADI", vbInformation, "BİLGİ")
Text1.Text = ""
Text1.SetFocus
Else
Dim stokg As New ADODB.Recordset
Dim stokc As New ADODB.Recordset
Dim g As Integer
Dim c As Integer
stokg.Open "select sum(adet) from ana where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
' özelikle buraları anlamadım
stokc.Open "select sum(adet) from ana where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
g = CInt(stokg("expr1000")) 'bu ("expr100") kodu nedir ne işe yarıyor
c = CInt(stokc("expr1000"))
Label11.Caption = g - c & " Adet"
text2.Text = bul("urun_adi")
End If
End If
End Sub
-
' "select * from urun where urun_no='" & Text1.Text & "'"
Açıklama: Text1 idli metin kutusunun içindeki değeri alıyor. Daha sonra onu urun tablosunda sorguluyor (Tüm bilgilerini).
If bul("urun_adi") = "" Then
Açıklama: Veritabanında aranan ürün bulunmamış ise.
stokg.Open "select sum(adet) from ana where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
Açıklama: ana adlı tabloda bu ürün numaraları ürünlerinin adetlerini topluyor (Bir nevi toplamkayıt alıyor.)
-
ontedi bunu yazdı
' "select * from urun where urun_no='" & Text1.Text & "'"
Açıklama: Text1 idli metin kutusunun içindeki değeri alıyor. Daha sonra onu urun tablosunda sorguluyor (Tüm bilgilerini).
If bul("urun_adi") = "" Then
Açıklama: Veritabanında aranan ürün bulunmamış ise.
stokg.Open "select sum(adet) from ana where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
Açıklama: ana adlı tabloda bu ürün numaraları ürünlerinin adetlerini topluyor (Bir nevi toplamkayıt alıyor.)
birinci sorum:
if bul("urunadi")="" then 'deyimi bir üstündeki sorguyla ilişkilimi yoksa ayrı bir mantıksal sınamamı ilişkili olsa if("urun_no")="" then demesi gerekmezmi.
ikinci sorum:
stokg.Open "select sum(adet) from ana where urun_no='" & Text1.Text & "'", "DSN=stok", adOpenStatic, adLockOptimistic
bu sorgu satırından iki tane var ikiside aynı yapılmak istenen işlem nasıl yapılacakki.
üçüncü sorum:
("expr1000") kodu nedir
-
cevap verecek olan yokmu.