Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot for the life of me figure out how to set the message type...

Status
Not open for further replies.

Wholsea

Programmer
Jun 16, 2004
138
US
The process below is executed from a VBS script in DOS.

The Code:

dim MQSess
dim qmgr
dim ITSOQueue
dim PutOptions
dim SampleMsg

Set MqSess = CreateObject("MQAX200.MqSession")
set qmgr = mqsess.accessqueuemanager(QMgr)
set samplequeue = qmgr.accessqueue(qname,16)
set samplemsg = mqsess.accessmessage()
set putoptions = mqsess.accessputmessageoptions()

samplemsg.format = MQFMT_STRING

outst = "This is a test"

samplemsg.messagedata = outst

putoptions = mqpmo_no_syncpoint + MQFMT_STRING

samplequeue.put samplemsg ', MQFMT_STRING


The message gets put on the queue fine, but when I have the MQA's look at the data format of the message, it is set to nothing. I cannot figure out how to set the message format to string.

Any help!?!?!

Maybe if I used the numerical equivilant to MQFMT_STRING instead of the key word (which I believe is blank under normal processing)

ASP, VB, VBS, Cold Fusion, SQL, DTS, T-SQL, PL-SQL, IBM-MQ, Crystal Reports, Crystal Enterprise
 
MQFMT_STRING is only specified in the Message descriptor not the message options.

Remove the + MQFMT_STRING from

putoptions = mqpmo_no_syncpoint + MQFMT_STRING

Then try again.
 
I think I've figured it out. MQFMT_STRING is not defined anywhere in the VB Script, I threw it in some quotation marks and the format showed up on the queue.

Weather it actually changed the format or not, that is still to be debated, but I successfully put a different format up on the queue...

ASP, VB, VBS, Cold Fusion, SQL, DTS, T-SQL, PL-SQL, IBM-MQ, Crystal Reports, Crystal Enterprise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top