Call a parameterized Oracle query from ADODB in Classic ASP

。_饼干妹妹 提交于 2019-12-01 05:25:52

How do you have filter_value defined? If it's not declared as a String or if you've assigned a string longer than 10 characters (as you've indicated when creating the parameter), you'll have issues with that.

Additionally (and partly for my own reference), named parameters are not supported via OraOLEDB (i.e. ADODB).

See Oracle® Provider for OLE DB Developer's Guide 11g Release 1 (11.1) or follow the "Command Parameters" heading link on any of the previous versions (8iR3, 9i, 9iR2, 10g, 10gR2):

Command Parameters

When using Oracle ANSI SQL, parameters in the command text are preceded by a colon. In ODBC SQL, parameters are indicated by a question mark (?).

OraOLEDB supports input, output, and input and output parameters for PL/SQL stored procedures and stored functions. OraOLEDB supports input parameters for SQL statements.

"Note: OraOLEDB supports only positional binding."

That said, this should have no bearing on your query when using OraOLEDB:

oFilteredList.NamedParameters = True

I've had success running queries exactly as the rest of your example shows though on Oracle 10gR2.

You don't show your connection string, so I must assume it to be valid. Behavior can differ depending on options there, so here's what I successfully use:

`"Provider=OraOLEDB.Oracle;Data Source=TNSNAMES_ENTRY;User ID=XXXX;Password=YYYY;DistribTx=0;"`
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!