AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi ADO und Intranet. Problemm mit CoInitialize
Thema durchsuchen
Ansicht
Themen-Optionen

ADO und Intranet. Problemm mit CoInitialize

Ein Thema von Pauli · begonnen am 23. Feb 2005 · letzter Beitrag vom 24. Feb 2005
 
Pauli

Registriert seit: 12. Dez 2003
Ort: Hamburg
10 Beiträge
 
Delphi 7 Professional
 
#6

Re: ADO und Intranet. Problemm mit CoInitialize

  Alt 23. Feb 2005, 14:54
Da wäre erstmal das:
Delphi-Quellcode:
unit DatamoduleUnit;

interface

uses
  {$IFDEF Linux}QForms, {$ELSE}Forms, {$ENDIF}
  SysUtils, Classes, DB, ADODB;

type
  TDataModule1 = class(TDataModule)
    ADOConnection1: TADOConnection;
  private
  public
  end;

// Procs
  function DataModule1: TDataModule1;

implementation
{$R *.dfm}

uses
  IWInit,
  ServerController;

// Since we are threaded we cannot use global variables to store form / datamodule references
// so we store them in WebApplication.Data and we could reference that each time, but by creating
// a function like this our other code looks "normal" almost as if its referencing a global.
// This function is not necessary but it makes the code in the main form which references this
// datamodule a lot neater.
// Without this function ever time we would reference this datamodule we would use:
// TDataModule1(WebApplication.Data).Datamodule.<method / component>
// By creating this procedure it becomes:
// TDataModule1.<method / component>
// Which is just like normal Delphi code.
function DataModule1: TDataModule1;
begin
  Result := TUserSession(RWebApplication.Data).Datamodule1;
end;

end.
und dann das zu sehen:
Delphi-Quellcode:
unit IWUnit1;
{PUBDIST}

interface

uses
  IWAppForm, IWApplication, IWTypes, IWCompButton, Classes, Controls,
  IWControl, IWCompEdit, DB, ADODB, IWCompListbox, IWDBStdCtrls, IWGrids,
  IWDBGrids, DBTables;

type
  TformMain = class(TIWAppForm)
    IWDBGrid1: TIWDBGrid;
    procedure IWAppFormCreate(Sender: TObject);
    procedure IWAppFormDestroy(Sender: TObject);
  public
  end;

implementation
{$R *.dfm}

uses
  ServerController, IWForm, ComObj;

procedure TformMain.IWAppFormCreate(Sender: TObject);
begin
  //tblMediaType.Open;
end;

procedure TformMain.IWAppFormDestroy(Sender: TObject);
begin
  //tblMediaType.Close;
end;

end.
Ich hoffe ich komme Dir nich so dumm vor

Danke.
Pauli
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz