D
delphi7tzj
Unregistered / Unconfirmed
GUEST, unregistred user!
下列程序在队列位于非本地机器时正常,但队列位于本地机器时提示事务使用方式无效,为何
var
qinfo:MSMQQueueInfo;
q:MSMQQueue;
msend:MSMQMessage;
xactlevariant;
formatname:string;
pathname:string;
msmqxact:MSMQCoordinatedTransactionDispenser;
begin
qinfo:=coMSMQQueueInfo.Create as MSMQQueueInfo;
q:=coMSMQQueue.Create as MSMQQueue;
msend:=coMSMQMessage.Create as MSMQMessage;
msmqxact:=coMSMQCoordinatedTransactionDispenser.Create as MSMQCoordinatedTransactionDispenser;
//formatname:='DIRECT=TCP:192.68.0.126/PRIVATE$/ReceiveTest';
//qinfo.FormatName:=formatname;
pathname:='./PRIVATE$/ReceiveTest';
qinfo.PathName:=pathname;
q:=qinfpen(MQ_SEND_ACCESS, MQ_DENY_NONE);
mSend.Body :='CM_table2_';
xact:=msmqxact.BeginTransaction;
mSend.Send(q,xact);
end;
var
qinfo:MSMQQueueInfo;
q:MSMQQueue;
msend:MSMQMessage;
xactlevariant;
formatname:string;
pathname:string;
msmqxact:MSMQCoordinatedTransactionDispenser;
begin
qinfo:=coMSMQQueueInfo.Create as MSMQQueueInfo;
q:=coMSMQQueue.Create as MSMQQueue;
msend:=coMSMQMessage.Create as MSMQMessage;
msmqxact:=coMSMQCoordinatedTransactionDispenser.Create as MSMQCoordinatedTransactionDispenser;
//formatname:='DIRECT=TCP:192.68.0.126/PRIVATE$/ReceiveTest';
//qinfo.FormatName:=formatname;
pathname:='./PRIVATE$/ReceiveTest';
qinfo.PathName:=pathname;
q:=qinfpen(MQ_SEND_ACCESS, MQ_DENY_NONE);
mSend.Body :='CM_table2_';
xact:=msmqxact.BeginTransaction;
mSend.Send(q,xact);
end;