SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2002
    Location
    South Wales, UK
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post What does this mean?

    Hey all!

    I'm looking at some code to connect to a database and was wondering what the numbers on the end mean. Any ideas?

    Code:
    RSBODY.Open SQLBODY, Conn, 1, 3
    Cheers..
    Do not underestimate the power of stupid people in large groups.

  2. #2
    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)
    Those number represent the ADO constants that would normally be used - adOpenStatic is equal to 3. for instance. I always use the named constants rather than numbers, but you can only do this if you include the ADO constants in your script. This used to be done by including the ADOVBS.INC file, but is nowadays better done by inserting the following line into your script before any <% %> tags:

    [VBS]<!-- METADATA TYPE="TypeLib" NAME="Microsoft ADO Type Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" -->
    [/VBS]

    That's it! Now you can refer to the constants by name rather than trying to remember the corresponding numbers - much more readable! I have it in my DB.ASP include file (part of my personal code library) along with all my other DB functions so that I never have to worry about it.


    M@rco


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
  •