Click to See Complete Forum and Search --> : VB and overflow error


kjoter
October 10th, 2001, 08:47 AM
Hello

I have a overflow problem using my VB program together with large data
amounts.
My program do read gets a txt file as inparameter, and splits it up line by
line, and puts it out on a MqSeries queue. When the txt file is bigger then
10 mb, i got the overflow message, and the program do end without
completing.

Some examples from the code.

'splits the inparameter (filename-infile and queuename-inqueue and
queuemanager)
cmds = Split(Command, " ", -1)
For i = 0 To UBound(cmds)
infile = cmds(0)
Inqueue = cmds(1)
QueueManager = cmds(2)
Debug.Print " Command "; i; " = "; cmds(i)
Next i



' Connect to the default queue manager
MQCONN "", gHcon, CompCode, Reason

fraPut.cboAPIRC.AddItem "MQCONN: CompCode = " + Str(CompCode) + ",
Reason Code = " + Str(Reason), 0
fraPut.cboAPIRC.ListIndex = 0

MQMD_DEFAULTS md
md.Format = MQFMT_STRING

MQPMO_DEFAULTS pmo

' Get message to be "put" from the Put text box
Buflen = Len(fraPut.txtPut.Text)
Buffer = fraPut.txtPut.Text
MQPUT gHcon, gHobj, md, pmo, Buflen, Buffer, CompCode, Reason
fraPut.cboAPIRC.AddItem "MQPUT: CompCode = " + Str(CompCode) + ", Reason
Code = " + Str(Reason), 0
fraPut.cboAPIRC.ListIndex = 0

Counter = Counter + 1

Do anyone have any ideas of other ways to do this, and avoid overflow?

TK

Cimperiali
October 10th, 2001, 10:43 AM
Change i and counter to a long data type
ie:
search for:
dim i as integer
dim counter as integer

and replace them with:
dim i as long
dim Counter as long

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater

kjoter
October 11th, 2001, 02:34 AM
Thank you Cimperiali. The answer made the day a lot better for me!

Cimperiali
October 11th, 2001, 02:41 AM
;-)
Have a nice day.


Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater