下面有一个在delphi中使用vc做的MTS,可能会对你有帮助..................
var
  Form1  : TForm1;
  IRoot  : IUnknown ;
  MyObj  : Ibus_Act ;
  MyComm :Ibus_Comm ;
.............procedure TForm1.Button1Click(Sender: TObject);
var
  s : widestring ;
begin
  IRoot := CreateComObject(ProgIDToClassID('Bus_ActC.bus_Act.1')) ;
  MyObj := IRoot as Ibus_Act ;
  s :=  'Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=SMS;Data Source=ZDS';
  try
    MyObj.Set_SMSConnection(s) ;
    showmessage(MyObj.SMSConnection) ;
    //showmessage('ok');
  except
    on e:exception do
        showmessage('err');
  end;end;

解决方案 »

  1.   

    下面有一个在delphi中使用vc做的MTS,可能会对你有帮助..................
    var
      Form1  : TForm1;
      IRoot  : IUnknown ;
      MyObj  : Ibus_Act ;
      MyComm :Ibus_Comm ;
    .............procedure TForm1.Button1Click(Sender: TObject);
    var
      s : widestring ;
    begin
      IRoot := CreateComObject(ProgIDToClassID('Bus_ActC.bus_Act.1')) ;
      MyObj := IRoot as Ibus_Act ;
      s :=  'Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=SMS;Data Source=ZDS';
      try
        MyObj.Set_SMSConnection(s) ;
        showmessage(MyObj.SMSConnection) ;
        //showmessage('ok');
      except
        on e:exception do
            showmessage('err');
      end;end;