What is the purpose(function) of the adovbs.inc fi

Results 1 to 2 of 2

Thread: What is the purpose(function) of the adovbs.inc fi

  1. #1
    Stephen of New York Guest

    Default What is the purpose(function) of the adovbs.inc fi

    Hi everyone. <BR>I have a quick question. I was reading an article about counting records. At the top of the script, they recommended constant definition. The top of the code is seen below.<BR>1. why did they have to include the adovbs.inc file ? <BR>2. what does this file do ? <BR>3. which constants were they defining ? thanks a lot<BR><BR>&#060;%&#039 BEGIN CONSTANT DEFINITION<BR> &#039 The following command includes the ADODB VBScript constants file.<BR> &#039 If you can&#039t find your copy you can download a copy from:<BR> &#039 http://www.asp101.com/samples/download/adovbs.inc<BR> &#039 It may not be the most recent copy so use it at your own risk. %&#062;<BR> &#060;!-- #INCLUDE FILE="./download/adovbs.inc" --&#062; &#060;% &#039 DB Configuration variables<BR> &#039 After this, strictly used as if it were a Const. Dim DB_CONNSTRING<BR> DB_CONNSTRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("./db_scratch.mdb") & ";"<BR> &#039 Now we override the above setting so the sample uses our SQL server.<BR> &#039 Comment out the following line to use the sample Access DB.<BR> DB_CONNSTRING = Application("SQLConnString") & _<BR> "UID=" & Application("SQLUsername") & ";" & _<BR> "PWD=" & Application("SQLPassword") & ";"&#039 END CONSTANT DEFINITION%&#062;

  2. #2
    Matt Riley Guest

    Default RE: What is the purpose(function) of the adovbs.in

    The adovbs.inc file contains constants for ActiveX Data Objects.<BR><BR>An example would be adCmdStoredProc which equates to the value 4.<BR>This could be used as follows:-<BR>cmdspUpdateRecords.CommandType = adCmdStoredProc<BR><BR>The adCmdStoredproc Constant simply saves you having to remember the value for the Stored Procedure Command Type and makes reading your code at a later date easier.<BR>This applies to a number of other Constants in the include file.<BR><BR>It&#039s worth having a look at the adovbs.inc file in notepad and matching the values up with the Constants, try applying them to different properties in the ADO Objects.<BR>

Posting Permissions

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