1

Konu: view kayıt yapmıyor.

sad

2 tane formum var.
biri tanım ( listenin bulunduğu)
diğeri giriscikis (veri girişi yapılacan yer.)
tanım ın
data session=2
windowstype=modeless
tablelar view buffermode=5 (view i içeren tableda burada mevcut)
sadece view de nodataonload=.t.

giriscikis ın
data session=1
windowstype=model
autoclose/open=.f.

tanım dan yeni dediğimde;

Visual Fox Pro
m.acik=.F.

    For Each loForm In _Screen.Forms
        If loForm.Name = "KSGIRISCIKIS"
            m.acik=.T.
            Exit
        Endif
    Endfor
 
    If m.acik=.F.
        Do Form Forms\KSGIRISCIKIS With .T.
    Else
        _Screen.KSGIRISCIKIS.WindowState = 0
        _Screen.KSGIRISCIKIS.Show
    Endif

giriscikis init

Visual Fox Pro
Parameters param1,param2

Thisform.ilave=param1
Thisform.yeniid=param2
Thisform.LockScreen = .T.
_Screen.AddProperty("KSGIRISCIKIS", Thisform)
If Thisform.ilave=.F.
    idsor=Thisform.yeniid
    Select KSTOKSATIRV
    Tableupdate(.T.)
    Requery()
 
    Thisform.txtBelgeno.Value=KSTOKSATIRV.belgeno
    Thisform.datepick1.TxtCalendar.Value=KSTOKSATIRV.belgetar
    Thisform.txtFirmadi.Value=KSTOKSATIRV.Firmadi
    Thisform.datepick2.TxtCalendar.Value=KSTOKSATIRV.gelistar
Else
    Thisform.yeniid=newid("KSGIRISCIKIS")
    idsor=Thisform.yeniid
    Select KSTOKSATIRV
    Insert Into KSTOKSATIRV(fisid) Values(Thisform.yeniid)
Endif
Thisform.Edit
Thisform.LockScreen = .F.
Thisform.Refresh

insert into ile satir lar ekliyorum.

kayıt;

Visual Fox Pro
Local llOk1,llOk2

Store .F. To llOk1,llOk1
Begin Transaction
Select KSTOKsatirv
m.llOk1= Tableupdate(.T., .T.,"KSTOKsatirv")
m.llOk2= Tableupdate(.T., .T.,"KSTOKsatir")
If m.llOk1 = .T. And m.llOk2 = .T.
    End Transaction
    Wait Window ('Ok.') Nowait
Else
    Aerror(lar1)
    Messagebox     (Chr(13)+Program(0)+Chr(13)+Program(1)+Chr(13)+Program(2)+Chr(13)+Program(3)+Chr(13)+Program(4)+Chr(13)+Program(5)+Chr(13))
    Messagebox ( 'Hata Kodu :'+Alltrim(Str(lar1(1,1)))+Chr(13)+'Hata Açık : ' +Alltrim(lar1(1,2))+Chr(13))
    Rollback
    =Tablerevert(.T., "KSTOKsatirv")
    =Tablerevert(.T., "KSTOKsatir")
Endif
Unlock All
Thisform.Release

Kaydet tıkladığımda veya mevcut bir kaydı açıp birşeyler eklesem bile kayıt yapmıyor.
Normalde KSTOKsatir i kaydettirmeye gerek yok diye düşünüyorum. çözüm bulmak amacı ile koydum.

Bilmediğin Neyse Yanıldığındır.

2

Re: view kayıt yapmıyor.

Böyle bir sorun bende yaşamıştım.  çetin hocamın bana mesaj olarak attığı daha sonraya buraya da gönderdiği şu kodları incelersen sorunu cçzersin. benim sorunum initteydi. smile

cetinbasoz yazdı:

Kod: visualfoxpro

      Public oForm
      oForm = Createobject('fox2xstyle')
      oForm.Show()
      Define Class fox2xstyle As Form
        DataSession = 2
        Height = 400
        Width = 800
        Caption = 'Fox2x Style'
        orecord = .Null.
        isadding = .F.
        isediting = .F.
        Add Object grdcustomer As Grid With ;
          Top = 10, Left = 10, Height = 300, Width = 370, ReadOnly = .T., RecordSource = "customer"
        Add Object txtcust_id As TextBox With ;
          Left = 462, Top = 55
        Add Object lblcust_id As Label With ;
          AutoSize = .T., Caption = "Cust_id", Left = 401, Top = 55
        Add Object txtcompany As TextBox With ;
          Left = 462, Top = 83, Width = 288
        Add Object lblcompany As Label With ;
          AutoSize = .T., Caption = "Company", Left = 401, Top = 83
        Add Object txtcontact As TextBox With ;
          Left = 462, Top = 111, Width = 219
        Add Object lblcontact As Label With ;
          AutoSize = .T., Caption = "Contact", Left = 401, Top = 111
        Add Object txttitle As TextBox With ;
          Left = 462, Top = 139, Width = 219
        Add Object lbltitle As Label With ;
          AutoSize = .T., Caption = "Title", Left = 401, Top = 139
        Add Object command1 As CommandButton With ;
          Top = 216, Left = 408, Height = 27, Width = 84, Caption = "Add"
        Add Object command2 As CommandButton With ;
          Top = 216, Left = 516, Height = 27, Width = 84, Caption = "Edit"
        Procedure Load
          Use customer
        Endproc
        Procedure Init
          With This
            Select customer
            Scatter Name This.oRecord Memo
            .txtCust_id.ControlSource = "thisform.oRecord.cust_id"
            .txtCompany.ControlSource = "thisform.oRecord.company"
            .txtContact.ControlSource = "thisform.oRecord.contact"
            .txtTitle.ControlSource   = "thisform.oRecord.title"
          ENDWITH
          this.SetAll('Enabled',.f.,'textbox')
          this.SetAll('DisabledForeColor',0,'textbox')
        Endproc
       
        Procedure grdcustomer.AfterRowColChange
          Lparameters nColIndex
          Scatter Name Thisform.oRecord Memo
          Thisform.Refresh()
        Endproc
       
        Procedure command1.Click
          If Thisform.isediting
            If Thisform.isadding
              Insert Into customer ;
                (cust_id) Values (Thisform.oRecord.cust_id)
            Endif
            Select customer
            Gather Name Thisform.oRecord Memo
            This.Caption = 'Add'
            This.Parent.Command2.Caption = 'Edit'
            Thisform.SetAll('Enabled',.F.,'textbox')
            Thisform.grdCustomer.Enabled = .T.
          Else
            Select customer
            Scatter Name Thisform.oRecord Memo Blank
            This.Caption = 'Save'
            This.Parent.Command2.Caption = 'Cancel'
            Thisform.SetAll('Enabled',.T.,'textbox')
            Thisform.grdCustomer.Enabled = .F.
          Endif
          Store !Thisform.isediting To ;
            thisform.isadding, ;
            thisform.isediting
          Thisform.Refresh()
        Endproc
       
        Procedure command2.Click
          If Thisform.isediting
            Select customer
            Scatter Name Thisform.oRecord Memo
            This.Caption = 'Edit'
            This.Parent.Command1.Caption = 'Add'
            Thisform.SetAll('Enabled',.F.,'textbox')
            Thisform.grdCustomer.Enabled = .T.
       
            Thisform.isadding = .F.
            Thisform.isediting = .F.
          Else
            This.Caption = 'Cancel'
            This.Parent.Command1.Caption = 'Save'
            Thisform.SetAll('Enabled',.T.,'textbox')
            Thisform.grdCustomer.Enabled = .F.
            Thisform.isadding = .F.
            Thisform.isediting = .T.
          Endif
          Thisform.Refresh()
        Endproc
      Enddefine


http://www.fox4um.com/viewtopic.php?pid=936#p936

3

Re: view kayıt yapmıyor.

selamlar;

Gönderidğiniz kodun sorunumla bir ilgisini göremedim.
Sorunum halen devam ediyor.

Bilmediğin Neyse Yanıldığındır.

4

Re: view kayıt yapmıyor.

Ramazan,
Sorun tam anlasılmıyor aslında. Aklıma gelen:
Hem view hem de update ettiği tableda buffer var ve sadece view mu update ediliyor?

aerror() orada işine yaramayabilir. 2 tableupdate() sonrası kullanıyorsun. hem error array'i parametre olarak ver de eger yapamazsa hangi kayıtların sorun oldugunu gor.

5

Re: view kayıt yapmıyor.

cetinbasoz yazdı:

Ramazan,
Sorun tam anlasılmıyor aslında. Aklıma gelen:
Hem view hem de update ettiği tableda buffer var ve sadece view mu update ediliyor?


hem view hemde table update etmiyor?

Bilmediğin Neyse Yanıldığındır.

6

Re: view kayıt yapmıyor.

Etmeyebilir. Nedenini sor VFP'ye. Belki de 'sendupdates = .t.' degildir.

7

Re: view kayıt yapmıyor.

'sendupdates = .t.' görünce aklıma geldi.
çetin abi teşekkür ederim.
Updatecriteria ayarlını yapmamaışım.

Bilmediğin Neyse Yanıldığındır.

8

Re: view kayıt yapmıyor.

bence .DBF dosyaları için view kullanmak eziyetten başka bişey değil...

Haksızlıklar karşısında susanlar, dilsiz şeytanlardır!
www.metinemre.com