OpenWriteQueue Error

doktordoktor Member Posts: 28
edited 2008-02-18 in Navision e-Commerce
Hi,

I use MSMQ and I have following problem. When I open SQL database and run code, this error appears.
"The call to member OpenWriteQueue failed. MSMQQueueInfo returned the following message. The format name specified is invalid."

When I create backup and restore it as native database the code run successfull.

I run it on the same computer as Administrator. The computer is in the domain.MSMQ create Administrator and security for TEST MSMQ is allow for everyone.

Thanks for any response

the code :

MQBus.OpenWriteQueue('.\private$\test',0,0);
MQBus.SenderAuthenticationLevel:= 0;
MQBus.ReceiveTimeout := 2000;

Comments

  • BBlueBBlue Member Posts: 90
    Hello,
    In my opinion, your problem is not because of sql db.
    The code you mentioned should work in pair with opening the queue first, for listening, form a single instance codeunit, with something like this:
    MQBus.OpenReceiveQueue('.\private$\test',0,0);
    

    On the other hand, the error sounds like the queue doesn't exist on the machine where you run the code, though you mentioned you run the code on the same machine... :-k

    Try to create a new private queue with this code (create a new codeunit and run it):
    IF ISCLEAR (MQBus) THEN
      CREATE(MQBus);
    MQBus.CreateQueue('.\private$\TestQueue');
    //MQBus.CreateQueue('MACHINENAME\private$\TestQueue');  //if the queue is about to be created on another machine on the network
    

    This creates a private queue specially configured for Nav. Then try to run your code with this queue.
    As far as I know, if you want to read/write from/to a queue that is on another machine, you can try:
    MQBus.OpenReceiveQueue('MACHINENAME\private$\test',1,0); //open queue for read
    MQBus.OpenWriteQueue('MACHINENAME\private$\test',1,0); //write to queue
    
    I hope this helps.
    //Bogdan
  • doktordoktor Member Posts: 28
    thanks it works
Sign In or Register to comment.