Author |
Message
|
shogan2003 |
Posted: Wed May 12, 2004 6:16 am Post subject: VBScript and MQSeries client 5.3 |
|
|
Centurion
Joined: 03 Jul 2003 Posts: 133 Location: London
|
Hi
I need to run MQSeries 5.3 client software on a Win2K platform.
I am restricted to VBScript.
I've downloaded the client software; there are .vbp files but I wonder whether there is a CSD I should download with other samples.
Has anyone got this to vbs to work with MQSeries client ?
Thanks in advance
Sean Hogan _________________ MQSI2 certified specialist
MQSeries certified specialist |
|
Back to top |
|
 |
JasonE |
Posted: Wed May 12, 2004 6:57 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
You cant use the vb interface from vbscript, but you can call the activex interface. Code similar to the following
Code: |
strQueueMgr = "QM"
qname = "QL"
MQOO_INPUT_AS_Q_DEF = CLNG(1)
set mqsession = CreateObject("mqax200.mqsession")
set aqm = mqsession.AccessQueueManager(strQueueMgr)
Set pq = aqm.AccessQueue(qname, 16 or 8192) ' MQOO_OUTPUT or MQ00_FAIL_IF_QUIESCING
Set pmsg = mqsession.AccessMessage()
ps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ···ÀÀÀ"
pmsg.writeString ps
Set pmo = mqsession.AccessPutMessageOptions()
pmsg.format = "MQSTR"
pmsg.CharacterSet = "819"
pq.Put pmsg, pmo
set pmsg = Nothing
set pq = Nothing
set aqm = Nothing
set mqsession = Nothing
|
PS Always use the latest fixpacks if possible, anyway. They dont contain more samples (well, they do add .net support and samples, but not new ones for existing languages) |
|
Back to top |
|
 |
shogan2003 |
Posted: Wed May 12, 2004 7:22 am Post subject: |
|
|
Centurion
Joined: 03 Jul 2003 Posts: 133 Location: London
|
Thanks for the reply. Is the sample you gave something I could embed in a .vbs script file ? _________________ MQSI2 certified specialist
MQSeries certified specialist |
|
Back to top |
|
 |
JasonE |
Posted: Wed May 12, 2004 7:46 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
That is my (only) .vbs file, but to be fair I normally launch it with cscript rather than via an asp or something like that so I cant really answer, sorry!
BTW to run it with client bindings you need mqserver or the mqchl* env vars for a client channel table. |
|
Back to top |
|
 |
shogan2003 |
Posted: Wed May 12, 2004 7:49 am Post subject: |
|
|
Centurion
Joined: 03 Jul 2003 Posts: 133 Location: London
|
Jason,
Thanks. I'll give it a go _________________ MQSI2 certified specialist
MQSeries certified specialist |
|
Back to top |
|
 |
|