Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should i have adovbs.inc file as include on each page?

Status
Not open for further replies.

kefi2927

IS-IT--Management
Apr 3, 2003
40
GB
Hi Guys
Can anyone steer me in the right direction?
I'm relatively new to asp.

I have an adovbs.inc file in my includes folder and did have it as an include on each page. I have taken the include off every page and my code still works. Thought I'd delete the adovbs.inc file when Dreamweaver told me i had links to each of the pages I had taken it off from!!
Thought it might have something to do with setting the connection to the database with this line that i have on most of my pages:
Set Conn=Server.CreateObject("ADODB.Connection")
But I'm only guessing this.

Can anybody advise me whether I can delete this file? What does it do? How does this still link to my pages if I've taken off the include from them? Does it relate to the line: Set Conn=Server.CreateObject("ADODB.Connection")

Thanks for any help.
 
I don't think it is necessary using:

Set Conn=Server.CreateObject("ADODB.Connection")

but I could be wrong. I'm no expert and a lot of my knowledge came from the fine folks here.

I don't use it and I connect fine. I think it's the way that you connect. I give a cn.connectionstring also on the page. If it works without it, which mine did, I wouldn't use it. There's no sense in it IMHO.

Trying to help, I hope I didn't confuse you more.



Rob
Just my $.02.
 
the adovbs.inc file is just a list of common constants that you may use in asp. You will probably only need a few (if any) of these constants. I suggest that you create your own list of constants that you do need and include only them. This file is larger than you need.

For instance, when opening a recordset, you can use the adovbs constant "adOpenForwardOnly" or just use its value "0"....

If you never use the constants (starting with an "ad") then you have no need for the include!

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
I include the VBScript constant in the global.asa like this.

This way I don't have to include it in every file.

<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft ActiveX Data Objects 2.5 Library&quot; UUID=&quot;{00000205-0000-0010-8000-00AA006D2EA4}&quot; VERSION=&quot;2.5&quot;-->
<SCRIPT LANGUAGE=&quot;VBScript&quot; RUNAT=&quot;Server&quot;>
Sub Application_OnStart
'Some Application Start Code
End Sub
Sub Session_OnStart
'Some Start Session Code
End Sub
Sub Session_OnEnd
'Some End Session Code
End Sub
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top