ASP Questions

musingattheruins at my-deja.com musingattheruins at my-deja.com
Sat Jul 15 08:15:25 EDT 2000


You can also call stored procs without the Command object by calling
Execute(SQLString) on the connection object... use SQLString = "EXEC
MyProcName param1, param2, etc" to call the proc.  Be sure that the
return is only one recordset or you'll confuse the heck out of
youself... (if using SQL Server 7.0 you can select 'results in grid' if
there is more than one tab (i.e., grid #1, grid #2) then you have an
extra select statement floating around.)  Also, avoid OUTPUT params if
you can.  Use select at the end of proc to return a 'tuple'... (select
@myret1 as "Result1", @myret2 as "Result2"), MoveNext() to the first
record.

> > #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]))


You might also try NAMING your params.  See command object name.  Then
the order should not matter.


> params = list(params)
> params.reverse()
>
> before that.  I don't see why it should make a difference, but it
does.

Regards :-)


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list