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?

Community
  • 1
  • 1
cregox
  • 17,674
  • 15
  • 85
  • 116

1 Answers1

2

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

D'Arcy Rittich
  • 167,292
  • 40
  • 290
  • 283
  • 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 – cregox Aug 16 '10 at 16:44
  • @Cawas: not really sure what you mean by "exactly how it's handling it" - won't outputting the query and values tell you that? – D'Arcy Rittich Aug 16 '10 at 16:55
  • 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. – cregox Aug 16 '10 at 17:05
  • 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. – D'Arcy Rittich Aug 16 '10 at 17:09