delphi oracle dataset getvariable,declareandset

function getComputerControl(pID: Integer;pComputerName:String): String;
var
  dset: TOracleDataSet;
begin
  dset:=TOracleDataSet.Create(nil);
  try
    dset.Session := Session;
    dset.SQL.Text :=  
     'begin ' +
     '  :result := QD.ComputerControl(vid => :vid,vterminaladi => :vterminaladi); '+
     'end;';
    dset.DeclareVariable('result',otString);
    dset.DeclareAndSet('vid',otInteger,pID);
    dset.DeclareAndSet('vterminaladi',otString,pComputerName);
    dset.Open;
    Result := dset.GetVariable('result');
  finally
    dset.Close;
    dset.Free;
  end;
end;

delphi runtime create oracle dataset

Ekim 4, 2010 2 yorum

Hi,
Large and complex in the projects , i will give a simple and useful example of an oracle dataset for avoid confusion.

function getRowCount:Integer;
var
   dset : TOracleDataSet;
begin
   try
      dset := TOracleDataSet.Create(nil);
      dset.Session:= OracleSession1;
      dset.SQL.Text:= 'select count(1) from QD.FIXED_TABLE';
      dset.Open;
      Result:= dset.Fields[0].AsInteger;
   finally
      dset.Close;
      dset.Free;
   end;
end;

delphi oracle event

Hi everyone,
Today , we will examine the dbms_alert.signal procedure of oracle database.We use “TOracleEvent” object for catching oracle events in Delphi. Firstly , we should configure object names and object types. You can see at below picture.

procedure TForm1.FormActivate(Sender: TObject);
begin
   Event.Start;
end;

procedure TForm1.FormClose(Sender: TObject);
begin
   Event.Stop;
end;

procedure TForm1.EventEvent(Sender: TOracleEvent; const ObjectName: String; const Info: Variant);
var
 I: Integer;
begin
   if CompareStr(ObjectName,'CHANGE')=0 then
   begin
     if VarIsArray(Info) then
     begin
        for I:=0 to VarArrayHighBound(Info,1) do
        begin
          if (Info[I] = 'UPDATE') then ShowMessage('Update table');
		  if (Info[I] = 'INSERT') then ShowMessage('Insert table');
        end;
     end;
   end
end;  

Below is an example use of dbms_alert.signal

CREATE OR REPLACE TRIGGER QD.FIXED_TABLE
  AFTER INSERT OR UPDATE ON QD.FIXED_TABLE
  FOR EACH ROW
DECLARE
 msg VARCHAR2(128);
BEGIN
   IF INSERTING THEN
     msg := 'INSERT';
	 dbms_alert.signal('CHANGE', msg);
  ELSIF UPDATING THEN
    msg := 'UPDATE';  
	dbms_alert.signal('CHANGE', msg);
  END IF;
END;

netbeans build-impl.xml:411: exec returned: 255 hatası

Eylül 23, 2010 Yorum bırakın

Netbeans ‘de derleme sırasında oluşan “build-impl.xml:411: exec returned: 255” hata proje adresindeki boşluk karakterinden meydana gelmektedir.Proje adresi “C:\Program Files\NetBeans 6.9\AndroidApplication6\nbproject\” gibi olursa proje derlenirken boşluk karakterinden dolayı “build-impl.xml:411: exec returned: 255” hatası verecektir.Bu sorunu gidermek için proje adresinde boşluk karakteri bulunmayacak şekilde verilmelidir.(Ör:”D:\Android\netbeans\AndroidApplication6\”)

delphi mutex

Ağustos 20, 2010 Yorum bırakın

Programın birden fazla açılmasını engellemek veya kontrol altına almak için mutex komutu kullanılır.

program MutexApp;

uses
  Forms,
  Windows,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

var
  Mutex : THandle;

begin
  Mutex := CreateMutex(nil, True, 'MutexApp.EXE');
  if (Mutex = 0) OR (GetLastError = ERROR_ALREADY_EXISTS) then
  begin
    Application.MessageBox(' Program kullanımda !!! ','Hata',MB_OK+MB_ICONWARNING);
  end else
  begin
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);
   Application.Run;
   if Mutex <> 0 then CloseHandle(Mutex);
  end;
end.

android sdk install

Temmuz 24, 2010 6 yorum

Google IP ‘lerine getirilen yasak sonucunda android kurulumunda connection time out hatası alınmaktadır.Bu hatayı almadan kurulumu yapabilmemiz için bilgisayarda birkaç değişiklik yapılması gerekmektedir.
1-)C:\Windows\System32\drivers\etc\ klasöründeki hosts dosyası içerisine alttaki bilgileri ekleyiniz.

209.85.229.99 http://www.youtube.com
209.85.229.99 youtube.com
74.125.65.118 img.youtube.com
74.125.13.80 v1.lscache1.c.youtube.com
74.125.13.83 v2.lscache1.c.youtube.com
74.125.13.86 v3.lscache1.c.youtube.com
74.125.13.89 v4.lscache1.c.youtube.com
74.125.13.92 v5.lscache1.c.youtube.com
74.125.13.95 v6.lscache1.c.youtube.com
74.125.13.98 v7.lscache1.c.youtube.com
74.125.13.101 v8.lscache1.c.youtube.com
74.125.97.17 v9.lscache1.c.youtube.com
74.125.97.84 v10.lscache1.c.youtube.com
74.125.13.87 v11.lscache1.c.youtube.com
74.125.13.90 v12.lscache1.c.youtube.com
74.125.13.93 v13.lscache1.c.youtube.com
74.125.13.96 v14.lscache1.c.youtube.com
74.125.13.99 v15.lscache1.c.youtube.com
74.125.97.38 v16.lscache1.c.youtube.com
74.125.13.82 v17.lscache1.c.youtube.com
74.125.13.85 v18.lscache1.c.youtube.com
74.125.13.88 v19.lscache1.c.youtube.com
74.125.13.91 v20.lscache1.c.youtube.com
74.125.13.94 v21.lscache1.c.youtube.com
74.125.13.97 v22.lscache1.c.youtube.com
74.125.13.100 v23.lscache1.c.youtube.com
74.125.13.103 v24.lscache1.c.youtube.com
74.125.13.80 v1.lscache2.c.youtube.com
74.125.13.83 v2.lscache2.c.youtube.com
74.125.13.86 v3.lscache2.c.youtube.com
74.125.13.89 v4.lscache2.c.youtube.com
74.125.13.92 v5.lscache2.c.youtube.com
74.125.13.95 v6.lscache2.c.youtube.com
74.125.13.98 v7.lscache2.c.youtube.com
74.125.13.101 v8.lscache2.c.youtube.com
74.125.13.81 v9.lscache2.c.youtube.com
74.125.13.84 v10.lscache2.c.youtube.com
74.125.13.87 v11.lscache2.c.youtube.com
74.125.13.90 v12.lscache2.c.youtube.com
74.125.13.93 v13.lscache2.c.youtube.com
74.125.13.96 v14.lscache2.c.youtube.com
74.125.13.99 v15.lscache2.c.youtube.com
74.125.13.102 v16.lscache2.c.youtube.com
74.125.13.82 v17.lscache2.c.youtube.com
74.125.13.85 v18.lscache2.c.youtube.com
74.125.13.88 v19.lscache2.c.youtube.com
74.125.13.91 v20.lscache2.c.youtube.com
74.125.13.94 v21.lscache2.c.youtube.com
74.125.13.97 v22.lscache2.c.youtube.com
74.125.13.100 v23.lscache2.c.youtube.com
74.125.13.103 v24.lscache2.c.youtube.com
74.125.99.80 v1.lscache3.c.youtube.com
74.125.99.83 v2.lscache3.c.youtube.com
74.125.99.86 v3.lscache3.c.youtube.com
74.125.99.89 v4.lscache3.c.youtube.com
74.125.99.92 v5.lscache3.c.youtube.com
74.125.99.95 v6.lscache3.c.youtube.com
74.125.99.98 v7.lscache3.c.youtube.com
74.125.99.101 v8.lscache3.c.youtube.com
74.125.99.81 v9.lscache3.c.youtube.com
74.125.99.84 v10.lscache3.c.youtube.com
74.125.99.87 v11.lscache3.c.youtube.com
74.125.99.90 v12.lscache3.c.youtube.com
74.125.99.93 v13.lscache3.c.youtube.com
74.125.97.32 v14.lscache3.c.youtube.com
74.125.99.99 v15.lscache3.c.youtube.com
74.125.99.102 v16.lscache3.c.youtube.com
74.125.99.82 v17.lscache3.c.youtube.com
74.125.99.85 v18.lscache3.c.youtube.com
74.125.99.88 v19.lscache3.c.youtube.com
74.125.99.91 v20.lscache3.c.youtube.com
74.125.99.94 v21.lscache3.c.youtube.com
74.125.99.97 v22.lscache3.c.youtube.com
74.125.99.100 v23.lscache3.c.youtube.com
74.125.99.103 v24.lscache3.c.youtube.com
74.125.99.80 v1.lscache4.c.youtube.com
74.125.99.83 v2.lscache4.c.youtube.com
74.125.99.86 v3.lscache4.c.youtube.com
74.125.99.89 v4.lscache4.c.youtube.com
74.125.99.92 v5.lscache4.c.youtube.com
74.125.99.95 v6.lscache4.c.youtube.com
74.125.99.98 v7.lscache4.c.youtube.com
74.125.99.101 v8.lscache4.c.youtube.com
74.125.99.81 v9.lscache4.c.youtube.com
74.125.99.84 v10.lscache4.c.youtube.com
74.125.99.87 v11.lscache4.c.youtube.com
74.125.99.90 v12.lscache4.c.youtube.com
74.125.99.93 v13.lscache4.c.youtube.com
74.125.99.96 v14.lscache4.c.youtube.com
74.125.99.99 v15.lscache4.c.youtube.com
74.125.99.102 v16.lscache4.c.youtube.com
74.125.99.82 v17.lscache4.c.youtube.com
74.125.99.85 v18.lscache4.c.youtube.com
74.125.99.88 v19.lscache4.c.youtube.com
74.125.99.91 v20.lscache4.c.youtube.com
74.125.99.94 v21.lscache4.c.youtube.com
74.125.99.97 v22.lscache4.c.youtube.com
74.125.99.100 v23.lscache4.c.youtube.com
74.125.99.103 v24.lscache4.c.youtube.com
74.125.99.16 v1.lscache5.c.youtube.com
74.125.99.19 v2.lscache5.c.youtube.com
74.125.99.22 v3.lscache5.c.youtube.com
74.125.99.25 v4.lscache5.c.youtube.com
74.125.99.28 v5.lscache5.c.youtube.com
74.125.99.31 v6.lscache5.c.youtube.com
74.125.99.34 v7.lscache5.c.youtube.com
74.125.99.37 v8.lscache5.c.youtube.com
74.125.99.17 v9.lscache5.c.youtube.com
74.125.97.20 v10.lscache5.c.youtube.com
74.125.99.23 v11.lscache5.c.youtube.com
74.125.170.154 v12.lscache5.c.youtube.com
74.125.99.29 v13.lscache5.c.youtube.com
74.125.99.32 v14.lscache5.c.youtube.com
74.125.99.35 v15.lscache5.c.youtube.com
74.125.99.38 v16.lscache5.c.youtube.com
74.125.99.18 v17.lscache5.c.youtube.com
74.125.99.21 v18.lscache5.c.youtube.com
74.125.99.24 v19.lscache5.c.youtube.com
74.125.99.27 v20.lscache5.c.youtube.com
74.125.99.30 v21.lscache5.c.youtube.com
74.125.99.33 v22.lscache5.c.youtube.com
74.125.99.36 v23.lscache5.c.youtube.com
74.125.99.39 v24.lscache5.c.youtube.com
74.125.99.16 v1.lscache6.c.youtube.com
74.125.99.19 v2.lscache6.c.youtube.com
74.125.99.22 v3.lscache6.c.youtube.com
74.125.99.25 v4.lscache6.c.youtube.com
74.125.99.28 v5.lscache6.c.youtube.com
74.125.99.31 v6.lscache6.c.youtube.com
74.125.99.34 v7.lscache6.c.youtube.com
74.125.99.37 v8.lscache6.c.youtube.com
74.125.99.17 v9.lscache6.c.youtube.com
74.125.99.20 v10.lscache6.c.youtube.com
74.125.99.23 v11.lscache6.c.youtube.com
74.125.99.26 v12.lscache6.c.youtube.com
74.125.99.29 v13.lscache6.c.youtube.com
74.125.99.32 v14.lscache6.c.youtube.com
74.125.99.35 v15.lscache6.c.youtube.com
74.125.99.38 v16.lscache6.c.youtube.com
74.125.99.18 v17.lscache6.c.youtube.com
74.125.99.21 v18.lscache6.c.youtube.com
74.125.99.24 v19.lscache6.c.youtube.com
74.125.99.27 v20.lscache6.c.youtube.com
74.125.99.30 v21.lscache6.c.youtube.com
74.125.99.33 v22.lscache6.c.youtube.com
74.125.99.36 v23.lscache6.c.youtube.com
74.125.99.39 v24.lscache6.c.youtube.com
74.125.170.208 v1.lscache7.c.youtube.com
74.125.170.211 v2.lscache7.c.youtube.com
74.125.170.214 v3.lscache7.c.youtube.com
74.125.170.217 v4.lscache7.c.youtube.com
74.125.170.220 v5.lscache7.c.youtube.com
74.125.170.223 v6.lscache7.c.youtube.com
74.125.170.226 v7.lscache7.c.youtube.com
74.125.170.229 v8.lscache7.c.youtube.com
74.125.170.209 v9.lscache7.c.youtube.com
74.125.170.212 v10.lscache7.c.youtube.com
74.125.170.215 v11.lscache7.c.youtube.com
74.125.170.218 v12.lscache7.c.youtube.com
74.125.170.221 v13.lscache7.c.youtube.com
74.125.170.224 v14.lscache7.c.youtube.com
74.125.170.227 v15.lscache7.c.youtube.com
74.125.170.230 v16.lscache7.c.youtube.com
74.125.170.210 v17.lscache7.c.youtube.com
74.125.170.213 v18.lscache7.c.youtube.com
74.125.170.216 v19.lscache7.c.youtube.com
74.125.170.219 v20.lscache7.c.youtube.com
74.125.170.222 v21.lscache7.c.youtube.com
74.125.170.225 v22.lscache7.c.youtube.com
74.125.170.228 v23.lscache7.c.youtube.com
74.125.170.231 v24.lscache7.c.youtube.com
74.125.170.208 v1.lscache8.c.youtube.com
74.125.170.211 v2.lscache8.c.youtube.com
74.125.170.214 v3.lscache8.c.youtube.com
74.125.170.217 v4.lscache8.c.youtube.com
74.125.170.220 v5.lscache8.c.youtube.com
74.125.170.159 v6.lscache8.c.youtube.com
74.125.170.226 v7.lscache8.c.youtube.com
74.125.170.229 v8.lscache8.c.youtube.com
74.125.170.209 v9.lscache8.c.youtube.com
74.125.170.212 v10.lscache8.c.youtube.com
74.125.170.215 v11.lscache8.c.youtube.com
74.125.170.218 v12.lscache8.c.youtube.com
74.125.170.221 v13.lscache8.c.youtube.com
74.125.170.224 v14.lscache8.c.youtube.com
74.125.170.227 v15.lscache8.c.youtube.com
74.125.170.230 v16.lscache8.c.youtube.com
74.125.170.210 v17.lscache8.c.youtube.com
74.125.170.213 v18.lscache8.c.youtube.com
74.125.170.216 v19.lscache8.c.youtube.com
74.125.170.219 v20.lscache8.c.youtube.com
74.125.170.222 v21.lscache8.c.youtube.com
74.125.170.225 v22.lscache8.c.youtube.com
74.125.170.228 v23.lscache8.c.youtube.com
74.125.170.231 v24.lscache8.c.youtube.com

74.125.43.103 docs.google.com
74.125.43.103 translate.google.com
74.125.43.103 code.google.com
74.125.43.103 pages.google.com
74.125.43.103 video.google.com
74.125.43.103 translate.google.com.tr
74.125.43.103 docs.google.com
74.125.43.103 sites.google.com
74.125.43.103 books.google.com
74.125.43.103 chrome.google.com
74.125.43.103 sketchup.google.com
74.125.43.103 froogle.google.com
74.125.43.103 labs.google.com
74.125.43.103 mars.google.com
74.125.43.103 moon.google.com
74.125.43.103 notebook.google.com
74.125.43.103 toolbar.google.com
74.125.43.103 browsersync.google.com
74.125.43.103 catalog.google.com
74.125.43.103 codesearch.google.com
74.125.43.103 dir.google.com
74.125.43.103 earth.google.com
74.125.43.103 groups.google.com.tr
74.125.43.103 shopping.google.com
74.125.43.103 sky.google.com
74.125.43.103 support.google.com
74.125.43.103 tools.google.com
74.125.43.103 wap.google.com
74.125.43.103 answers.google.com
74.125.43.103 google-analystics.com
74.125.43.103 clients2.google.com
72.14.213.136 khm0.google.com
72.14.213.91 mt0.google.com
72.14.213.136 khm1.google.com
72.14.213.136 mt1.google.com
72.14.213.93 lh4.ggpht.com
74.125.53.139 gg.google.com
72.14.213.136 khm0.google.com
72.14.213.91 mt0.google.com
72.14.213.136 khm1.google.com
72.14.213.136 mt1.google.com
72.14.213.93 lh4.ggpht.com
74.125.53.139 gg.google.com
72.14.213.93 kh.google.com
72.14.213.103 maps.google.com
72.14.213.113 auth.keyhole.com
74.125.43.105 earth.google.com

74.125.43.103 lh1.ggpht.com
74.125.43.103 lh2.ggpht.com
74.125.43.103 lh3.ggpht.com
74.125.43.103 lh4.ggpht.com
74.125.43.103 lh5.ggpht.com
74.125.43.103 lh6.ggpht.com
74.125.43.103 lh7.ggpht.com
74.125.43.103 lh8.ggpht.com
74.125.43.103 picasaweb.google.com.tr
74.125.43.103 picasaweb.google.com

2-) DNS bilgilerinin aşağıdaki gibi değiştirilmesi gerekmektedir.

3-)   SDK Setup.exe çalıştırılarak aşağıdaki ayarlar yapılır :

Setting kısmında http force çeki atılır

Add on site kısmında : http://dl-ssl.google.com/android/repository/repository.xml eklenir.

Bu işlemler sonra Install Selected denilerek kurulum işlemine başlanır.

delphi exe information

Mayıs 24, 2010 Yorum bırakın
procedure TForm1.VersionInfo;
const
   InfoStr : array [1..11] of String =
     (
       'CompanyName', 'FileDescription', 'FileVersion',
       'InternalName', 'LegalCopyright', 'LegalTradeMarks',
       'OriginalFilename', 'ProductName', 'ProductVersion',
       'Comments', 'Author'
      );
var
   pLen, j , pHandle : Cardinal;
   VersionBuf,
   VersionValue      : PChar;
begin
  pHandle:=GetFileVersionInfoSize(PChar(Application.ExeName),pHandle);
  if pHandle > 0 then
  begin
    VersionBuf:=AllocMem(pHandle);
    GetFileVersionInfo(PChar(Application.ExeName),0,pHandle,VersionBuf);
    For J:=1 to 11 do begin
      If VerQueryValue(VersionBuf,
                              PChar('StringFileInfo\041F04E6\'+InfoStr[j]),
                              Pointer(VersionValue),
                              pLen) Then
        ListBox.Items.Add(InfoStr[j] +' = '+VersionValue) ;
    end;
    FreeMem(VersionBuf,pHandle);
  end else
    ListBox.Items.Add('Versiyon bilgisi bulunamadı') ;
end;

delphi lisans hatası

Nisan 29, 2010 2 yorum

“Borland License information was found, but it is not valid for delphi
You can not run delphi without this information. “
hatasını verirse aşağıdaki işlemleri yaparak çözebilirsiniz.

1-) “C:\documents and settings\username\ .borland \registry.slm” dosyasını siliniz
2-) “C:\program files\borland\delphi7\bin\D7Reg.exe” çalıştırınız.
3-) D7Reg.exe kurulumu bitirdikten sonra Delphi7’yi çalıştırınız.

delphi uygulamayı başlangıca atma (Windows StartUp)

uses Registry;

procedure writeStartUp;
var
  fRegistry: TRegistry;
begin
  fRegistry:=TRegistry.Create;
  try
    // Geçerli kullanıcı için HKEY_CURRENT_USER
    // Bilgisayar için HKEY_LOCAL_MACHINE 
    fRegistry.RootKey := HKEY_CURRENT_USER;
    fRegistry.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', True);
    fRegistry.WriteString('Uygulamam','C:\Project1.exe');
    fRegistry.CloseKey;
  finally
    fRegistry.Free;
  end;
end;
Kategoriler:Delphi

delphi procedure,function bildirimleri(overload,forward)

forward:
Bazı durumlarda bir procedür veya bir fonksiyonu çağırmadan önce o procedure/function varlığını derleyiciye bildirmemiz gerekir.Tanımlandığı yerden daha önce çağrılıyorsa Undeclared Identifier hatasını verir.Basit bir örnekle açıklarsak: iki procedürümüz olsun.(procedure d1, procedure d2)
procedure d1;
begin

end;
procedure d2;
begin

end;

Böyle bir tanımlamada d2 procedüründen d1 çağrılabilir ama d1 procedüründen d2 çağrılamaz.Bu sorunu çözmek için aşağıdaki şekilde tanımlama yaparak çözeriz.

procedure d2; forward;
procedure d1;
begin
d2;
end;
procedure d2;
begin
d1;
end;

overload : Overload olayına aynı procedure/funtion ‘da farklı parametreler girmemiz veya aynı olay için farklı sayıda parametre girmemiz gibi durumlar meydana geldiğinde ihtiyaç duyulur.
örnek tanımlama ise:

procedure appmessage(metin: string; adet: integer); overload
procedure appmessage(metin: string); overload