怎么可能还不行,你试了没有。
以下是以前我的一个mts数据模块:
unit Udmmts;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComServ, ComObj, VCLCom, StdVcl, bdemts, DataBkr, DBClient,
MtsRdm, Mtx, Pdmmts_TLB, Provider, DB, ADODB,Variants;
type
Tdmmts = class(TMtsDataModule, Idmmts)
adoc: TADOConnection;
adoqusers: TADODataSet;
dspusers: TDataSetProvider;
adoquserroles: TADODataSet;
adoqprivilege: TADODataSet;
adoqroles: TADODataSet;
dspuserroles: TDataSetProvider;
dsproles: TDataSetProvider;
adoqusersname: TStringField;
adoqusersrealname: TStringField;
adoquserspasswd: TStringField;
adoquserscanlogin: TBooleanField;
adoquserslinkphone: TStringField;
adoqusersemail: TStringField;
adoquserscomment: TMemoField;
adoquserrolesname: TStringField;
adoquserrolesrole: TStringField;
adoqprivilegename: TStringField;
adoqprivilegecdname: TStringField;
adoqrolesrole: TStringField;
adoqrolesrolename: TStringField;
adoqrolescomment: TMemoField;
dspmodules: TDataSetProvider;
adomodules: TADOQuery;
adomodulesid: TStringField;
adomodulesname: TStringField;
adomodulespid: TStringField;
adomodulesdescription: TMemoField;
susers: TDataSource;
droles: TDataSource;
adoqprivilegecomment: TMemoField;
adodm_wz: TADODataSet;
adodm_gf: TADODataSet;
adodm_kf: TADODataSet;
adodm_ck: TADODataSet;
adodm_fk: TADODataSet;
dspdm_wz: TDataSetProvider;
dspdm_gf: TDataSetProvider;
dspdm_kf: TDataSetProvider;
dspdm_ck: TDataSetProvider;
dspadodm_fk: TDataSetProvider;
adodm_wzdm: TStringField;
adodm_wztxdm: TStringField;
adodm_wzmc: TStringField;
adodm_wzjldw: TStringField;
adodm_wzlb: TStringField;
adodm_wzjhdj: TBCDField;
adodm_wzxsdj: TBCDField;
adodm_wzpfdj: TBCDField;
adodm_wzkcup: TBCDField;
adodm_wzkcdn: TBCDField;
adodm_wzgfdm: TStringField;
adodm_wzbz: TMemoField;
adodm_gfdm: TStringField;
adodm_gfmc: TStringField;
adodm_gfaddr: TStringField;
adodm_gfyzbm: TStringField;
adodm_gftel: TStringField;
adodm_gfsui_no: TStringField;
adodm_gfbank_no: TStringField;
adodm_gfbank: TStringField;
adodm_gflxr: TStringField;
adodm_gfbz: TMemoField;
adodm_kfdm: TStringField;
adodm_kfmc: TStringField;
adodm_kfaddr: TStringField;
adodm_kfyzbm: TStringField;
adodm_kftel: TStringField;
adodm_kfsui_no: TStringField;
adodm_kfbank_no: TStringField;
adodm_kfbank: TStringField;
adodm_kflxr: TStringField;
adodm_kfbz: TMemoField;
adodm_ckdm: TStringField;
adodm_ckmc: TStringField;
adodm_ckdz: TStringField;
adodm_cklb: TStringField;
adosplb: TADODataSet;
dspsplb: TDataSetProvider;
adosplbid: TStringField;
adosplbname: TStringField;
adosplbpid: TStringField;
adosplbdescription: TMemoField;
adogflb: TADODataSet;
StringField1: TStringField;
StringField2: TStringField;
StringField3: TStringField;
MemoField1: TMemoField;
dspgflb: TDataSetProvider;
adokflb: TADODataSet;
StringField4: TStringField;
StringField5: TStringField;
StringField6: TStringField;
MemoField2: TMemoField;
dspkflb: TDataSetProvider;
adosqlgen: TADOQuery;
dspsqlgen: TDataSetProvider;
adodm_gflb: TStringField;
adodm_kflb: TStringField;
procedure MtsDataModuleActivate(Sender: TObject);
procedure MtsDataModuleDeactivate(Sender: TObject);
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
public
{ Public declarations }
end;
var
dmmts: Tdmmts;
implementation
{$R *.DFM}
var
rolename:OleVariant;
class procedure Tdmmts.UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
begin
if Register then
begin
inherited UpdateRegistry(Register, ClassID, ProgID);
EnableSocketTransport(ClassID);
EnableWebTransport(ClassID);
end else
begin
DisableSocketTransport(ClassID);
DisableWebTransport(ClassID);
inherited UpdateRegistry(Register, ClassID, ProgID);
end;
end;
procedure Tdmmts.MtsDataModuleActivate(Sender: TObject);
begin
adoc.Connected :=true;
end;
procedure Tdmmts.MtsDataModuleDeactivate(Sender: TObject);
begin
adoc.Connected :=false;
end;
initialization
TComponentFactory.Create(ComServer, Tdmmts,
Class_dmmts, ciMultiInstance, tmApartment);
end.
最好发代码给我可以帮你调一下。
longbin@gliet.edu.cn