SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is adovbs.inc important

    Hi all,

    I'm a beginner in ASP and I don't use adovbs.inc in my code

    I know what it's for but why is better to use it ?

    The problem is I don't have access to the server that my code will be uploaded to, and I don't know what's on it.

    So if I use adovbs.inc do I have to put the file with my scripts ?

    It's a 15 KB file, Is using it feasible?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.asp101.com/articles/john/adovbs/default.asp

    I understood that adovbs.inc has to be included in my code to use the constants,
    meaning that it has to be in all my folders that contain files using these constants to use this

    <!-- #include file="adovbs.inc" -->

    is that correct?

    I know it's a silly question
    but I can't stop thinking why didn't Microsoft think of it earlier and include it automatically ??!!

  3. #3
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Including the ADOVBS.INC file is the old-hat way of doing things. A better way is to include the following line at the top of your script (outside the <% %> tags) or even better, stick it in your global.asa!!

    Code:
    <!-- METADATA TYPE="TypeLib" NAME="Microsoft ADO Type Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" -->
    This will load the same constants, but it will obtain them directly from the ADO Type Library.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  4. #4
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now matter what way you include it, it will do you no good unless you are actually using it . You only need the ADOVBS constants if you want to have text descriptions (contsant names) of ADO's numeric values when working with databases.

    I hardly ever need to change those ADO properties so I never use the constants. The times when I could use ADOVBS are when I need that "3" property when opening recordsets. Other than that, default properties usually work for me!

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Wes DeMoney
    Now matter what way you include it, it will do you no good unless you are actually using it . You only need the ADOVBS constants if you want to have text descriptions (contsant names) of ADO's numeric values when working with databases.
    Of course, that goes without saying!

    Originally posted by Wes DeMoney
    I hardly ever need to change those ADO properties so I never use the constants. The times when I could use ADOVBS are when I need that "3" property when opening recordsets. Other than that, default properties usually work for me!
    However, be aware that the default properties are designed for compatibility, not performance and/or scalability, and so I do not recommend that approach.

    Also, in my previous post I failed to state what (admittedly minor) advantages using the METADATA tag offered, these being a tiny performance increase, and full enumeration of all supported ADO constants (which possibly may not be fully covered in the ADOVBS.INC file), as well as greatly increasing the readability/maintainability of your code, and reducing the number of script files in your site by one!!!
    Last edited by M@rco; Sep 23, 2002 at 18:15.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank u M@cro and Wes DeMoney

    I like that METADATA approach better

    I like professional-looking code so that's why I want use the constants + the slight speed increase u talked about.

    I hope I'll be able to continue working on my project soon,


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •