views:

6

answers:

1

Following this other question on how to make parametrized sql query on classic asp, I now ask how to debug it?

I can write in a CommandText with it, and execute, but I can't see which SQL command I'm actually trying to run. So is there a way to check ADODB.Command's output to SQL?

+2  A: 

Unfortunately not, you'll need to replace the query parameter tokens with the actual values yourself when outputting for tracing.

RedFilter
That'd be fine if I knew exactly how ADO was handling it, and why it's throwing me random errors instead of working! :P
Cawas
@Cawas: not really sure what you mean by "exactly how it's handling it" - won't outputting the query and values tell you that?
RedFilter
@RedFilter let's say I throw it a value like this "`this's a value`". What will it do with the quote sign? More yet, I want to just get the SQL String, copy and paste to SQL Query Analyzer and see if it works.
Cawas
When using parameterized queries, it does nothing with quotes as it does not need to. The values are passed in as is, no escaping needed. For getting a runnable query, you'll need to construct it yourself, quoting etc. as needed, based on data types.
RedFilter