Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Creating a Recordset in VBScript using ADO


Message #1 by "Jeffrey Morrow" <jmorrow@u...> on Wed, 12 Apr 2000 23:5:54
I am trying to create a Recordset in VBScript using ADO, but VBScript does 

not seem to understand some of the arguments that I am passing to .Append 

method.  Here is the Recordset definition:



    adoRecords.Fields.Append "CommName", adVarChar, 75, adFldUpdatable

    adoRecords.Fields.Append "Prefix_FName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Number_LName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Suffix_Board", adVarChar, 100, 

adFldUpdatable

    adoRecords.Fields.Append "Date", adDate, , adFldUpdatable

    adoRecords.Fields.Append "Time", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Room", adVarChar, 10, adFldUpdatable

    adoRecords.Fields.Append "Priority", adInteger, , adFldUpdatable



when I "run" the Active Server Page, I get an error.  The error reads:



   Variable not defined: adVarChar



If anyone has defined and used a Recordset in VBScript using ADO please 

help.



Thanks much.



Message #2 by "William Milne" <wmilne01@e...> on Thu, 13 Apr 2000 11:26:43
Jeffrey



This would work in a VB project if the relevant ADO/RDS libraries were 

referenced in the project. As this is VBScript you have to explicitly 

define all enumerators as constants e.g. Const adVarChar = 200 as they are 

not part of the VBScript space. The Wrox books usually list these and there 

are also include files which you can use.



William Milne



On 04/13/00, ""Jeffrey Morrow" wrote:

> I am trying to create a Recordset in VBScript using ADO, but VBScript does

not seem to understand some of the arguments that I am passing to .Append

method.  Here is the Recordset definition:



    adoRecords.Fields.Append "CommName", adVarChar, 75, adFldUpdatable

    adoRecords.Fields.Append "Prefix_FName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Number_LName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Suffix_Board", adVarChar, 100, 

adFldUpdatable

    adoRecords.Fields.Append "Date", adDate, , adFldUpdatable

    adoRecords.Fields.Append "Time", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Room", adVarChar, 10, adFldUpdatable

    adoRecords.Fields.Append "Priority", adInteger, , adFldUpdatable



when I "run" the Active Server Page, I get an error.  The error reads:



   Variable not defined: adVarChar



If anyone has defined and used a Recordset in VBScript using ADO please 

help.



Thanks much.

Message #3 by sehamzee@a... on Thu, 13 Apr 2000 08:39:48 -0400

you need to include this line in your ASP:

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



This should take care of your problems.









"Jeffrey Morrow" on 04/12/2000 07:05:54 PM



Please respond to "ASP Databases" <asp_databases@p...>



To:   "ASP Databases" <asp_databases@p...>

cc:    (bcc: Shawn E Hamzee/OR4/AEPIN)



Subject:  [asp_databases] Creating a Recordset in VBScript using ADO









I am trying to create a Recordset in VBScript using ADO, but VBScript does

not seem to understand some of the arguments that I am passing to .Append

method.  Here is the Recordset definition:



    adoRecords.Fields.Append "CommName", adVarChar, 75, adFldUpdatable

    adoRecords.Fields.Append "Prefix_FName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Number_LName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Suffix_Board", adVarChar, 100,

adFldUpdatable

    adoRecords.Fields.Append "Date", adDate, , adFldUpdatable

    adoRecords.Fields.Append "Time", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Room", adVarChar, 10, adFldUpdatable

    adoRecords.Fields.Append "Priority", adInteger, , adFldUpdatable



when I "run" the Active Server Page, I get an error.  The error reads:



   Variable not defined: adVarChar



If anyone has defined and used a Recordset in VBScript using ADO please

help.



Thanks much.

Message #4 by "Morrow, Jeff" <jmorrow@u...> on Thu, 13 Apr 2000 12:15:39 -0500
Thank you for your help I solved my problem by including the ADO type

library in my Active Server Page.



-----Original Message-----

From: William Milne 

Sent: Thursday, April 13, 2000 6:27 AM

To: ASP Databases

Subject: [asp_databases] Re: Creating a Recordset in VBScript using ADO





Jeffrey



This would work in a VB project if the relevant ADO/RDS libraries were 

referenced in the project. As this is VBScript you have to explicitly 

define all enumerators as constants e.g. Const adVarChar = 200 as they are 

not part of the VBScript space. The Wrox books usually list these and there 

are also include files which you can use.



William Milne



On 04/13/00, ""Jeffrey Morrow" wrote:

> I am trying to create a Recordset in VBScript using ADO, but VBScript does

not seem to understand some of the arguments that I am passing to .Append

method.  Here is the Recordset definition:



    adoRecords.Fields.Append "CommName", adVarChar, 75, adFldUpdatable

    adoRecords.Fields.Append "Prefix_FName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Number_LName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Suffix_Board", adVarChar, 100, 

adFldUpdatable

    adoRecords.Fields.Append "Date", adDate, , adFldUpdatable

    adoRecords.Fields.Append "Time", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Room", adVarChar, 10, adFldUpdatable

    adoRecords.Fields.Append "Priority", adInteger, , adFldUpdatable



when I "run" the Active Server Page, I get an error.  The error reads:



   Variable not defined: adVarChar



If anyone has defined and used a Recordset in VBScript using ADO please 

help.



Thanks much.

Message #5 by "Morrow, Jeff" <jmorrow@u...> on Thu, 13 Apr 2000 12:15:55 -0500
I did, and it did, thank you.



-----Original Message-----

From: sehamzee@a... 

Sent: Thursday, April 13, 2000 7:40 AM

To: ASP Databases

Subject: [asp_databases] Re: Creating a Recordset in VBScript using ADO







you need to include this line in your ASP:

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



This should take care of your problems.









"Jeffrey Morrow" on 04/12/2000 07:05:54 PM



Please respond to "ASP Databases" <asp_databases@p...>



To:   "ASP Databases" <asp_databases@p...>

cc:    (bcc: Shawn E Hamzee/OR4/AEPIN)



Subject:  [asp_databases] Creating a Recordset in VBScript using ADO









I am trying to create a Recordset in VBScript using ADO, but VBScript does

not seem to understand some of the arguments that I am passing to .Append

method.  Here is the Recordset definition:



    adoRecords.Fields.Append "CommName", adVarChar, 75, adFldUpdatable

    adoRecords.Fields.Append "Prefix_FName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Number_LName", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Suffix_Board", adVarChar, 100,

adFldUpdatable

    adoRecords.Fields.Append "Date", adDate, , adFldUpdatable

    adoRecords.Fields.Append "Time", adVarChar, 25, adFldUpdatable

    adoRecords.Fields.Append "Room", adVarChar, 10, adFldUpdatable

    adoRecords.Fields.Append "Priority", adInteger, , adFldUpdatable



when I "run" the Active Server Page, I get an error.  The error reads:



   Variable not defined: adVarChar



If anyone has defined and used a Recordset in VBScript using ADO please

help.



Thanks much.



---

You are currently subscribed to asp_databases 



  Return to Index