Hello...
I'm using VS.NET 2003 to debug an ASP application locally. Everything
has been working fine, until I was re-working some code. I changed the
code to use a command object to execute a stored procedure against a
new database. The old code used connection.Execute against a different
database. My project was created using an empty C# web project and
adding all my asp pages. It has no web.config, and is only configured
for ASP debugging under Project Properties--no asp.net debugging.
My main page is program_upgrades.asp which has an <!--#include
file="functionality.asp"-->. Code below is from functionality.asp.
-- SNIP --
' <Dim Statements Omitted>
Set crmConnection = Session("db_conn_6") 'pre-initialized, new database
connection
Set paramCompCode = Server.CreateObject("ADODB.Parameter")
Set paramPartID = Server.CreateObject("ADODB.Parameter")
Set paramPlatform = Server.CreateObject("ADODB.Parameter")
Set paramReturnValue = Server.CreateObject("ADODB.Parameter")
Set command = Server.CreateObject("ADODB.Command")
' <Parameter construction statements omitted>
command.Name = "IsProductModuleOwned"
command.CommandType = adCmdStoredProc
command.NamedParameters = True
' <Parameters.Append statements omitted>
Set command.ActiveConnection = crmConnection
Stop
' Next statement causes an error, which is why I'm trying to debug.
command.Execute , , adExecuteNoRecords
-- SNIP --
If I run the app using F5 in VS.NET, it will stop at the "Stop"
statement. At that point I can examine variables such as
command.Parameters(0) in the watch window, but if i try to Set Next
Statement it brings up the "Resolve Ambiguity" dialog, which has no
locations to select from.
If I remove the Stop statement and place a breakpoint at "Set
command.ActiveConnection = crmConnection" it doesn't stop at the
breakpoint. But it DOES break into the code when the "command.Execute
, , adExecuteNoRecords" line causes an error. In this scenario I can
examine variables, but again if I try to Set Next Statement it brings
up the "Resolve Ambiguity" dialog, which again has no locations to
select from.
In either case, the Command Window does this:
? paramPartID.Value
121
paramPartID.Value = 122
Unable to evaluate the expression.
command.Parameters.Refresh
Unable to evaluate the expression.
Debugging was working fine until I added the code to use the command
object.
(PS the error that the command.Execute line raises is "Microsoft OLE DB
Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver]Syntax
error or access violation", but that shouldn't cause debugging not to
work. The error, I think, can be resolved by constructing my
parameters collection correctly, but can't check that out til I can
debug.)
Any ideas?
Travis