delphi program yazma hatası

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
talip28
Üye
Mesajlar: 3
Kayıt: 07 Ara 2005 04:34

delphi program yazma hatası

Mesaj gönderen talip28 »

Kod: Tümünü seç

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables;

type
  TForm1 = class(TForm)
    Table1: TTable;
    Table1STOKKODU: TStringField;
    Table1STOKADI: TStringField;
    Table1BIRIMI: TStringField;
    Table1ADEDI: TFloatField;
    Table1ALISFIYATI: TFloatField;
    Table1SATISFIYAT: TFloatField;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Button1: TButton;
    Button2: TButton;
    Edit6: TEdit;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label3: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.Text:=table1STOKKODU.Text;
edit2.Text:=table1STOKADI.Text;
edit3.Text:=table1BIRIMI.Text;
edit4.Text:=table1ADEDI.Text;
edit5.Text:=table1ALISFIYATI.Text;
edit6.Text:=table1SATISFIYAT.Text;

end;
//İLK KAYIT
procedure TForm1.Button1Click(Sender: TObject);
begin
table1.Next;
edit1.Text:=table1STOKKODU.Text;
edit1.Text:=table1STOKADI.Text;
edit1.Text:=table1BIRIMI.Text;
edit1.Text:=table1ADEDI.Text;
edit1.Text:=table1ALISFIYATI.Text;
edit1.Text:=table1SATISFIYAT.Text;

end;
// SONRAKİ KAYIT
procedure TForm1.Button2Click(Sender: TObject);
begin
table1.Prior;
edit1.Text:=table1STOKKODU.Text;
edit2.Text:=table1STOKADI.Text;
edit3.Text:=table1BIRIMI.Text;
edit4.Text:=table1ADEDI.Text;
edit5.Text:=table1ALISFIYATI.Text;
edit6.Text:=table1SATISFIYAT.Text;

end;
//YENİ KAYIT
procedure TForm1.Button3Click(Sender: TObject);
begin
table1.Append;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit1.SetFocus;

end;
//KAYDET
procedure TForm1.Button4Click(Sender: TObject);
begin
table1.UpdateRecord;
table1STOKKODU.Text:=edit1.Text;
table1STOKADI.Text:=edit2.Text;
table1BIRIMI.Text:=edit3.Text;
table1ADEDI.Text:=edit4.Text;
table1ALISFIYATI.Text:=edit5.Text;
table1SATISFIYAT.Text:=edit6.Text;

end;
//SİL
procedure TForm1.Button5Click(Sender: TObject);
BEGIN
tus:=application.MessageBox('kayıt silinsinmi','uyarı',mb_yesno);
if tus=idyes then

 begin
table1.Delete;
table1.Prior;
edit1.Text:=table1STOKKODU.Text;
edit2.Text:=table1STOKADI.Text;
edit3.Text:=table1BIRIMI.Text;
edit4.Text:=table1ADEDI.Text;
edit5.Text:=table1ALISFIYATI.Text;
edit6.Text:=table1SATISFIYAT.Text;
end;

end.
Düzenleyen Coderlord: Code tagları arasına alalım okunurluk artsın.


BU stok takip PROGRAMINI ÇALIŞTIRDIĞIMDA İLK ÖNCE SİL BUTONU KISMINDA HATA VERİYOR İMLEC "TUS" KELİMESİNDEN SONRAYA KONUMLANIYOR. BUALANI SİLİP PROGRAMI ÇALIŞTIRIP EDİTLERE DEĞERLER GİRDİĞİMDE HERHANGİ BUTONA BASTIĞIMDA "DEBUGBER EXCEPTION NOTIFICATION" ADINDA Bİ UYARI PENCERESİ GELİYO VE İÇİNDE "PROJECT PROJECT1.EXE RAISED EXCEPTION CLASS EDATABASEERROR WITH MESSAGE 'TABLO1: CANNOT PERFORM THİS OPERATION ON A CLOSED DATASET'. PROCES STOPPED.USE STEP OR RUN TO CONTİNUE." SORUNUN NE OLDUĞUNU BULAMADIM İNLEYEYİP BULAN OLURSA NEDENİNİ YAZARSA SEVİNİRİM.İYİ BAYRAMLAR
Büyük harf kullanmanın bağırmak anlamına geldiğini de unutmayalım - CL
Kullanıcı avatarı
hbahadir
Kıdemli Üye
Mesajlar: 544
Kayıt: 06 Ara 2004 05:03
Konum: BURSA idi artık İST.
İletişim:

Mesaj gönderen hbahadir »

ilk önce forum ve net kurallarına uyalım lütfen.

Hata mesajında veritabanın açık değil diyor. Veritabanını

Kod: Tümünü seç

Table1.Open;
ile açabilirsin.
Cevapla