Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2004, 11:54 PM
Authorized User
 
Join Date: Apr 2004
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default ado type library in global.asa

I am interested in opinions about including the ado type library in the global.asa file. Is this a huge benefit? Is it worthwhile to do, especially when you will host your web applications on a remote web server hosted by a company. Is it preferrable to use the path or UUID?

If I understand correctly, defining the ado type library in the global.asa file will allow you to do the following in your code:
(please correct me if I am wrong)

Opening a recordset without the ado typelib in the global.asa
<%
Dim Recordset1
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_DBConn_STRING
Recordset1.Source = "SELECT * FROM tblPerson"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1.Close()
Set Recordset1 = Nothing
%>

Opening a recordset with the ado typelib in the global.asa
<%
Dim Recordset1
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_DBConn_STRING
Recordset1.Source = "SELECT * FROM tblPerson"
Recordset1.Open "constants would be here instead of numerical values"
Recordset1.Close()
Set Recordset1 = Nothing
%>

Is this the correct idea? Making code easier to read? I'm just trying to understand the benefits.

Thanks for any input!
-Dman100-

 
Old August 4th, 2004, 03:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

You're correct. I always use that method, both for readability and because it's so much easier to remember words over numbers.
Using the UUID is a safe approach because you can’t really be sure that the DLL is in the same location on your ISPs server.
 - mega
 
Old August 4th, 2004, 09:20 AM
Authorized User
 
Join Date: Apr 2004
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mega,

Thanks for replying to my post. I appreciate the information. As a follow-up, if the UUID is for version 2.7 and the web server is using 2.5 for example, then will the code generate an error?

I guess what I'm asking is I have to make sure the UUID stays consistant with the ado type library version on the hosted server?

Is there an easy way to do this? I'm just trying to cover my bases so that I know what to watch out for and avoid any sudden errors if the hosting company updates their ado type library version.

Thanks again for your help!
-Dman100-

 
Old August 5th, 2004, 11:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

I don't think so. The lib is just a lot of constants and I don't believe that MS removed the widely used constants from one version to the next. The one I showed is for ADO 2.0 and has all the const I use.
ADO 2.5 - {00000205-0000-0010-8000-00AA006D2EA4}
ADO 2.5 and 2.7 - {00000300-0000-0010-8000-00AA006D2EA4}
You can search your registration (Regedt32) and see the different UUID.
Another way is to copy the ADOVBS.inc file from your pc and put it on the web server, and include it like this wherever you use constants: . You can find it in C:\Program Files\Common Files\System\ado. But I have never experienced the above method to fail.

 - mega
 
Old August 6th, 2004, 09:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Dman100,

If you prefer to go for using ADOVBS.inc, then you can copy ADOVBS.inc file from that path and store it within the root directory of your web app and use that within your asp files using include directive. Also while porting it from one web server to the other, that file too gets ported along with your web application. So you wouldn't have any problem with it getting missed.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Global.asa pushpa Classic ASP Basics 19 March 9th, 2007 08:30 AM
About Global.asa pbcatan Classic ASP Databases 2 December 4th, 2006 12:40 AM
Global.asa gmoney060 Classic ASP Basics 3 September 25th, 2004 09:11 AM
FPSpread ADO type library rajupusapati ADO.NET 0 January 22nd, 2004 12:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.