D
Dooza
Hi there,
I was provided a custom com object that is on a intranet webserver, its
a stocktake component that hooks into an ERP system called Streamline.
The sample code that was provided as in VB, and I managed to use it in
an ASP application.
During single user testing we didn't run into any problems, but when in
a multi-user environment we receive an occasional error. When I
contacted the vendor about this error, this is what I was told:
What I did in my VB program to get the error:
a click button with code - dimensioned the xacstocktake object at the
start of the click code (dim stocktake as xacstocktake) and called it as
an early bound object (set stocktake = new xacstocktake). Then I did two
updates (stocktake.UpdateStocktake). Once I hit the end of the sub, the
stocktake object was terminated (since it was defined in the sub). This
termination of the stocktake object shut down all tables, connections,
instances and sessions in the stocktake object. When I clicked on the
button again, I got the object variable error as the session for the
stocktake object had been terminated.
What I did in my VB program to NOT get the error:
The xacstocktake object was dimensioned at the start of the program.
The click button had pretty much the same code but as the xacstocktake
object was not defined in the click sub, it was not terminated when the
sub was completed. Next (and all subsequent) time I clicked on the
button, the update by the xacstocktake object was fine. I then
terminated the xacstocktake object when I unloaded the form.
-----------------------------------------------------------------------
This all makes sense if we were running an application, but we are doing
this via wireless barcode scanners that have IE, hence using ASP.
There are 2 calls to the object, one to validate the item being scanned,
and one to update the stocktake entry.
I use this at the start of each page that calls the object:
Dim macstocktake
Set macstocktake = Server.CreateObject("xacslappsexe40.xacstocktake")
And this at the end:
Set macstocktake = nothing
Can I put this in global.asa using Session_OnStart and Session_OnEnd?
Dooza
I was provided a custom com object that is on a intranet webserver, its
a stocktake component that hooks into an ERP system called Streamline.
The sample code that was provided as in VB, and I managed to use it in
an ASP application.
During single user testing we didn't run into any problems, but when in
a multi-user environment we receive an occasional error. When I
contacted the vendor about this error, this is what I was told:
What I did in my VB program to get the error:
a click button with code - dimensioned the xacstocktake object at the
start of the click code (dim stocktake as xacstocktake) and called it as
an early bound object (set stocktake = new xacstocktake). Then I did two
updates (stocktake.UpdateStocktake). Once I hit the end of the sub, the
stocktake object was terminated (since it was defined in the sub). This
termination of the stocktake object shut down all tables, connections,
instances and sessions in the stocktake object. When I clicked on the
button again, I got the object variable error as the session for the
stocktake object had been terminated.
What I did in my VB program to NOT get the error:
The xacstocktake object was dimensioned at the start of the program.
The click button had pretty much the same code but as the xacstocktake
object was not defined in the click sub, it was not terminated when the
sub was completed. Next (and all subsequent) time I clicked on the
button, the update by the xacstocktake object was fine. I then
terminated the xacstocktake object when I unloaded the form.
-----------------------------------------------------------------------
This all makes sense if we were running an application, but we are doing
this via wireless barcode scanners that have IE, hence using ASP.
There are 2 calls to the object, one to validate the item being scanned,
and one to update the stocktake entry.
I use this at the start of each page that calls the object:
Dim macstocktake
Set macstocktake = Server.CreateObject("xacslappsexe40.xacstocktake")
And this at the end:
Set macstocktake = nothing
Can I put this in global.asa using Session_OnStart and Session_OnEnd?
Dooza