Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with VB6 and Websphere-Client

42 views
Skip to first unread message

Stephan Lux (PYLON AG)

unread,
Jul 31, 2003, 8:49:08 AM7/31/03
to
Hi,

i have some problems with opening a queue on a websphere 5.3 server with a
visual basic application. The reasoncode of MQOPEN is 2085 - invalid
queuename. The name of the queue is correct, because the sample program
amqsputc.exe could open it without errors.

The only difference between the sample and my application is, that i use
MQCONNX function, cause it is nessesary to change the websphere server in
the running system. To change the MQSERVER enviroment variable for the
MQCONN function the dll must be unloaded and that is not possible.

Does someone have an idea, what could cause this problem? Why could amqsputc
open the queue but not my application?

Here is my code:

'*************************************************************************
'Object descriptor
'*************************************************************************
Type MQOD
StrucId As String * 4 'Structure identifier'
Version As Long 'Structure version number'
ObjectType As Long 'Object type'
ObjectName As String * 48 'Object name'
ObjectQMgrName As String * 48 'Object queue manager name'
DynamicQName As String * 48 'Dynamic queue name'
AlternateUserId As String * 12 'Alternate user identifier'
RecsPresent As Long 'Number of object records present'
KnownDestCount As Long 'Number of local queues opened
successfully'
UnknownDestCount As Long 'Number of remote queues opened
successfully'
InvalidDestCount As Long 'Number of queues that failed to open'
ObjectRecOffset As Long 'Offset of first object record from start
of MQOD'
ResponseRecOffset As Long 'Offset of first response record from
start of MQOD'
ObjectRecPtr As MQPTR 'Address of first object record'
ResponseRecPtr As MQPTR 'Address of first response record'
AlternateSecurityId As MQBYTE40 'Alternate security identifier'
ResolvedQName As String * 48 'Resolved queue name'
ResolvedQMgrName As String * 48 'Resolved queue manager name'
End Type
'*************************************************************************
'MQOD Default
'*************************************************************************
Sub MQOD_DEFAULTS(Struc As MQOD)
Struc.StrucId = MQOD_STRUC_ID
Struc.Version = MQOD_VERSION_1
Struc.ObjectType = MQOT_Q
Struc.ObjectName = ""
Struc.ObjectQMgrName = ""
Struc.DynamicQName = "AMQ.*"
Struc.AlternateUserId = ""
Struc.RecsPresent = 0
Struc.KnownDestCount = 0
Struc.UnknownDestCount = 0
Struc.InvalidDestCount = 0
Struc.ObjectRecOffset = 0
Struc.ResponseRecOffset = 0
Dim TempObjectRecPtr As MQPTR
MQPTR_DEFAULTS TempObjectRecPtr
Struc.ObjectRecPtr = TempObjectRecPtr
Dim TempResponseRecPtr As MQPTR
MQPTR_DEFAULTS TempResponseRecPtr
Struc.ResponseRecPtr = TempResponseRecPtr
Dim TempAlternateSecurityId As MQBYTE40
MQBYTE40_DEFAULTS TempAlternateSecurityId
Struc.AlternateSecurityId = TempAlternateSecurityId
Struc.ResolvedQName = ""
Struc.ResolvedQMgrName = ""
End Sub
'*************************************************************************
' MQOPEN
'*************************************************************************
MQOD_DEFAULTS udtMQOD
udtMQOD.ObjectName = inQueueName
udtMQOD.ObjectType = MQOT_Q
udtMQOD.ObjectQMgrName = inQueueManager
'MQ aufrufen
MQOPEN mlngConnectionHandle, udtMQOD, inOptions, mlngQHandle,
mlngCompCode, mlngReason
'*************************************************************************


Best regards,
Stephan Lux
PYLON AG

Ron Bower

unread,
Jul 31, 2003, 1:32:18 PM7/31/03
to
I don't know anything about VB. My guess as to what is wrong would be that
your queue name in VB has some garbage at the end of the string that MQ is
picking up as part of the name. The queue name is 48 characters and is
preset to nothing when in C. I'd guess that VB is only setting the actual
characters in the name and not the remaining 48 characters.

Ron

"Stephan Lux (PYLON AG)" <steph...@pylon.de> wrote in message
news:bgb3bg$6npg$1...@news.boulder.ibm.com...

Glenn Baddeley

unread,
Aug 1, 2003, 12:01:02 AM8/1/03
to
Ron / Stephan,

Setting a STRING * 48 data type (.ObjectName) from a STRING data type
(inQueueName) will add space padding out to 48 chars, and this should work OK on
a MQOPEN (I've done it in VB).

I suggest adding a message box or debug point just before opening the queue and
check that the object name is *exactly the same* as the object being opened on
the queue manager. Its easy to make a typo, eg. hyphen vs underscore, O instead
of 0, etc.

eg. MsgBox "udtMQOD.ObjectName=[" & udtMQOD.ObjectName & "]" or
Debug.Print
MQOPEN ....

Cheers,
Glenn, IBM GSA

Stephan Lux (PYLON AG)

unread,
Aug 6, 2003, 10:23:09 AM8/6/03
to
Hi Glenn,

thanks for your help, but i have allready checked this. The name is the same
like the used one in the amqsputc sample.
Does you have some ideas?

Bye
Stephan

"Glenn Baddeley" <Baddeley.Glenn...@team.telstra.com> schrieb im
Newsbeitrag news:3F29E5FE...@team.telstra.com...

Vinoo Palayoor

unread,
Aug 6, 2003, 9:27:34 PM8/6/03
to
Stephan,

Is it possible that you have MQ server loaded on the machine that is trying
to open this queue? If that is the case, are you setting the MQType
correctly in your compilation arguments? This needs to be set to
excplicitly use the MQ client or server libraries.

Thanks,
Vinoo Palayoor

"Stephan Lux (PYLON AG)" <steph...@pylon.de> wrote in message

news:bgr33u$3haq$1...@news.boulder.ibm.com...

Stephan Lux (PYLON AG)

unread,
Aug 8, 2003, 2:59:12 AM8/8/03
to
Hi,

first of all, thanks for your help!

Today I have solved the problem, if someone has similar problems here is the
solution: In the MQOD structure of the openqueue function the QueueManager
name had been set. After setting it to a nullstring my function works!

Regards Stephan

"Vinoo Palayoor" <vinoo.p...@staples.com> schrieb im Newsbeitrag
news:bgsa20$3bkc$1...@news.boulder.ibm.com...

0 new messages