{"id":119,"date":"2006-12-26T08:58:20","date_gmt":"2006-12-26T13:58:20","guid":{"rendered":"\/cgi\/wp\/?p=119"},"modified":"2006-12-26T09:07:03","modified_gmt":"2006-12-26T14:07:03","slug":"how-to-reference-a-type-library-in-vbscript","status":"publish","type":"post","link":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=119","title":{"rendered":"How To Reference A Type Library In VBScript"},"content":{"rendered":"<p>In an Active Server Pages script, you can reference a type library using the METADATA tag.  This automatically imports the constants from a DLL. It is usually used for ADO constants and eliminates the need for the adovbs.inc include file.<\/p>\n<p>&lt;!&#0045;&#0045;METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft ActiveX Data Objects 2.6 Library&quot; UUID=&quot;{00000206-0000-0010-8000-00AA006D2EA4}&quot; VERSION=&quot;2.6&quot; &#0045;&#0045;&gt;<\/p>\n<p>You can do the same thing with a VBScript for Windows Script Host. I like to use these types of scripts for scheduled tasks because you cannot schedule an ASP page to run on schedule. Recently I had to create a VBScript to send out email reminders using the CDO.Message object so I needed to import its type library. The following code allows you to use a type library with Windows Script Host. You must use the WSF file extension because the script will be parsed as XML:<\/p>\n<pre>&lt;?xml version=&quot;1.0&quot;?&gt;\r\n&lt;job id=&quot;script1&quot;&gt;\r\n&lt;reference guid=&quot;CD000000-8B95-11D1-82DB-00C04FB1625D&quot;&gt;&lt;\/reference&gt;\r\n&lt;script language=&quot;VBScript&quot;&gt;\r\n&lt;![CDATA[\r\n' script code follows here\r\n]]&gt;\r\n&lt;\/script&gt;\r\n&lt;\/job&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In an Active Server Pages script, you can reference a type library using the METADATA tag. This automatically imports the constants from a DLL. It is usually used for ADO constants and eliminates the need for the adovbs.inc include file. &hellip; <a href=\"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=119\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/119"}],"collection":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":0,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"wp:attachment":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}