ASP Questions

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Fri Jul 14 06:39:22 EDT 2000


In article <m6qrms8p9min910o1ok1mlbtg0bi33hhts at 4ax.com>,  (Sam) wrote:

> Session("key") = value is a VBScript specific thing.  Its bypassing
> the default method of Session which in this case is probably Item.
> I'm not sure off hand.

Waldemar sorted this out -- thanks Waldemar.

> >Response.Redirect doesn't terminate execution of the script.  I'm 
> getting >round this by throwing an exception, but is there a command 
> that can do >the same job more cleanly?
> 
> Have you tried a return statement?  I'm guessing here but the asp page
> is probably being executed in some kind of invisible function.

No, doesn't work.

> >I ran a script with an infinite loop once.  How should I have 
> terminated >it (other than by proof reading my code better)?
> 
> Not sure.  The same has happened to us in vbscript and we ended up
> shutting down the server.  He forgot the recordset.movenext while in a
> loop processing a recordset.  Typically if you can get to the box fast
> enough before the ram is swallowed up you can shutdown iis.  Otherwise
> I think it was the power button because the box was totally
> unresponsive.  There may be a page execution timeout that can be
> specified in iis.  I don't remember off hand.

It was MoveNext for you as well!

> #Here is the line you are probably missing.
> cmd.CommandType = constants.adCmdStoredProc

No, I'm setting it to 4 which should be equivalent.

> #Now I append the parameters...
> for parm in params:
>     cmd.Parameters.Append(cmd.CreateParameter(parm[0], parm[1],
> constants.adParamInput, parm[2], parm[3]))

Ah, but try

params = list(params)
params.reverse()

before that.  I don't see why it should make a difference, but it does.

> The reason that ado is ignoring your parameters is that the default
> command type is adCmdText.  I guess when it is text it doesn't bother
> to look for any parameters associated with the command object.  Though
> it might if your sql looked like "select * from whatever where id = ?"
> IIRC ? is used in the data environment designer in VB to denote a
> parameter in  an sql call.

It isn't ignoring the parameters, it's ignoring their names.  It would be 
nice to supply the parameters in an arbitrary order.  Seeing as the names 
have to be supplied, you would think they were being used for something.


          Graham



More information about the Python-list mailing list