Passing Parameters to a Stored Procedure using ASP

@KekuSemau is correct but let me a suggest a more efficient and manageable approach then using the adovbs constants file.

METADATA allows you to define a reference to the DLLs constants even if your using Late Binding as is the case in a Classic ASP environment. It's probably worth mentioning that you can add METADATA references in individual pages but then again why would you?

To use it simply add the METADATA tag to your global.asa file (should be located in the root of your Web Application).

<!-- 
METADATA TYPE="typelib" FILE="C:\Program Files\Common Files\System\ADO\msado20.tlb"
-->

Depending on the system the ADO Type Library maybe different, adjust the FILE attribute accordingly.

I use this approach in all my applications mainly for referencing constants in the ADO and CDO Type Libraries.

ADO Type Library

<!--
METADATA 
TYPE="typelib" 
FILE="c:\program files\common files\system\ado\msado15.dll"
-->

CDO Type Library

<!-- 
METADATA 
TYPE="typelib" 
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" 
NAME="CDO for Windows 2000 Library"
-->

These are examples of my own personal references, file locations maybe different whereas UUID attributes should be exactly the same.

IMPORTANT:

Remember to remove any references to adovbs constant include file (adovbs.inc or adovbs.asp commonly) when using METADATA approach in your global.asa or you will get a

Name redefined error

Also METADATA is only available in IIS 4.0 and above.


Useful Links

  • Using METADATA to Import DLL Constants (Recommended reading)