Documente Academic
Documente Profesional
Documente Cultură
RedBack
B
A WEB APPLICATION DEVELOPMENT TOOL
®
All rights to this publication are reserved. No part of this document may be reproduced, transmitted,
transcribed, stored in a retrieval system, or translated into any language, in any form or by any means, without
prior written permission from Informix Software, Corp. If you are a licensed user of this product, Informix
Software, Corp. grants you a limited, nontransferable license to reproduce this particular document. This is
limited to photocopy reproduction of a Informix Software-supplied master copy. Copies must include all pages
contained in the master copy (including this page) and must be intended strictly for internal distribution and use
by the licensee, its employees, and assigns. Reproduced copies may not be transferred, in whole or in part, to
any party outside the licensee’s place(s) of business. The software described in this document is furnished
under a license agreement. The software may be used or copied only in accordance with the terms of the agree-
ment. It is against the law to copy this software on magnetic tape, disk, or any other medium for any purpose
other than the licensee's personal use.
Informix Software, Corp., reserves the right to make changes to this document and the software described
herein at any time and without notice. Informix Software, Corp. makes no warranty, express or implied, other
than those contained in the terms and conditions of sale, and in no case is Informix Software, Corp. liable for
more than the license fee or purchase price of this product.
Informix Software is a trademark of Informix Software Corp. RedBack, uniVerse, UniData, SB+, SBOPEN,
SBClient, SBDesktop, ObjectCall, EasyX, DataStage, ESL, UniVerse Call Interface, UniVerse Objects, uV/
Net, RetrieVe, PI/open and Prime INFORMATION are trademarks of Informix Software, Corp. Pick is a regis-
tered trademark of Pick Systems. Microsoft, Windows, Windows NT, ActiveX and Visual Basic are registered
trademarks of Microsoft Corporation in the United States and or other countries. UNIX is a registered trade-
mark in the United States and other countries, licensed through X/Open Company. Java, and JavaBeans are a
trademark of Sun MicroSystems. Delphi is a trademark of the Inprise Corporation. All other products, stan-
dards, or company names mentioned may be trademarks or registered trademarks of their respective owners.
Contents
RedPages 5
Contents
6 RedPages
Contents
RedPages 7
Contents
8 RedPages
Preface - Introduction to
Informix Documentation
This preface contains useful information about Informix’s conventions for documenting command
syntax and system output, as well as providing explanations of the specially designed icons that
indicate important notes, tips, and warnings in the documentation.
RedPages 9
Conventions
All Informix manuals depict command syntax according to industry standards. The following table
lists the syntax conventions:
Convention Description
bold courier font Bold courier font indicates text that you must enter in the manner
shown. You must enter all punctuation marks that appear in bold,
unless otherwise indicated.
courier font Courier font indicates system output, such as prompt signs, responses
to commands, and program code. Courier font is also used to depict
paths to directories or files.
bold Bold font indicates the name of an element on the screen, such as a
menu, a form, or a prompt. It also indicates the names of files or direc-
tories, and for the names of objects, properties, methods, events, func-
tions, and subroutines where they appear in the main text of the
manual.
lower case italics Lower case italics is used for syntactical expression of user-supplied
words, variables, and expressions
xx Italic lower-case xx indicates a placeholder for an application id. For
example, xxCONTROL.
<> Field, denotes a supplied name or value or an HTML tag.
> The > character separates each option in a menu hierarchy. For exam-
ple, “choose Setup > Miscellaneous”, means choose the Setup menu
then the Miscellaneous option.
[] Square brackets indicate an item that is optional. You may include a
number of items enclosed in brackets in a Unidata command or func-
tion.
{} Braces indicate that you must choose one of the items separated by the
vertical bar ( | ).
Conventions
10 RedPages
Convention Description
| Vertical bar separates option arguments from which you may choose.
... An ellipsis (...) after an argument indicates that you may use more than
one argument on a single command line.
Conventions (continued)
Note
A Note icon indicates important additional information on the subject.
RedPages 11
Warning
A Warning icon alerts you to the danger of deleting or corrupting data.
Reminder
A Reminder icon marks information that is discussed in detail in another chapter or Informix
manual.
Tip
A Tip icon denotes shortcuts, commands, or procedures that may help you use Informix products
more efficiently.
12 RedPages
Chapter 1 - Installation
This chapter provides general information about the installation of the RedBack Gateway, which
contains the Redpages ActiveX component, redpages.dll.
RedPages 13
Chapter 1 - Installation
Installation Details
Microsoft’s Data Access Components (MDAC) version 2.1 or later must be installed prior to the
RedBack Gateway installation. This provides the required Microsoft libraries to allow the
RedPages ActiveX component to successfully communicate with the web server and ActiveX
Data Objects (ADO).
Please refer to the “Getting Started” manual for a step-by-step guide to installing the Redback
Gateway.
14 RedPages
Chapter 2 - Introduction
This chapter provides a general introduction to RedPages (RedBack aware Active Server Pages)
with RedBack.
Note
This manual describes the interaction of RedBack with Microsoft’s Active Server Pages technol-
ogy. Due to this association all of the code examples shown in this manual refer to VBScript code
inside .ASP files and it is assumed that user has some experience in ASP and VBScript.
RedPages 15
Chapter 2 - Introduction
Note
ASP is not a scripting language. ASP simply provides an environment within which you can run
script code from your HTML pages.
16 RedPages
What are Active Server Pages?
Note
It is beyond the scope of this manual to explain the details of ASP. For more information, refer to
the documentation provided with the ASP software or the numerous books written on the subject.
Note
Script code can be written in any language for which an ActiveX scripting engine is available. ASP
as supplied by Microsoft ships with scripting engines for VBScript and JScript, both of which can
be used to develop code that runs on the web server.
Note
Refer to Microsoft documentation supplied with the Microsoft Internet Information Server for
more information regarding VBScript and JavaScript.
RedPages 17
Chapter 2 - Introduction
RedPage Architecture
RedPages functionality is provided by redpages.dll which is an ActiveX component that develop-
ers can access via method calls in their scripting language. The redpages.dll runs in the same pro-
cess space as the Microsoft Internet Information Server.
18 RedPages
What are RedPages?
The RedPages DLL provides communication between the web server and the RedBack gateway as
shown in the following illustration:
Scheduler
Web Browser
Gateway Requester Gateway Responder
Internet
UniData uniVerse
RedBack components
Access to the redpages.dll is made via ActiveX Data Objects (ADO). ADO is a Microsoft technol-
ogy for an application-level programming interface. ADO, is a database programming model that
allows programmers to write applications over OLE DB from many programming languages
including Visual Basic, Java, VBScript, JScript, and C/C++.
RedPages 19
Chapter 2 - Introduction
OLE DB
Data Provider
RedBack Gateway
uniVerse/UniData RDBMS
RedPages will typically be used as a mechanism to populate the data fields on a form before the
HTML page is sent back to the client web browser. RedPages can also be used for queries which
will return a table of data for convenient report generation.
The RedPages DLL has two sides to it. On one side it performs the functionality of rgw.dll i.e. pro-
vides all of the communication ofthe RedBack Gateway Requester which in turn communicates
with the RedBack Scheduler on the uniVerse/UniData backend. On other side, it is an OLE DB
provider which, through ADO, exposes methods and a collection of form data fields which are
name/value pairs that can be interrogated or overwritten as required.
20 RedPages
What are RedBack Business Objects?
The RedBack Business Object model provides the following major benefits:
• Freedom to design HTML pages and graphics using third party web design tools such as
Visual Interdev, FrontPage, HomeSite and other HTML/ASP development tools. Accord-
ingly RedBack enables developers to use either Active Server Pages (known as RedPages)
or RedBack data aware Java components (known as RedBeans) when designing websites
or applications.
• Ability to define business objects that contain the business logic (fields, calculations etc)
using the RedBack Designer. The RedBack Designer has been designed to be quick and
intuitive to use and requires almost no knowledge of the uniVerse/UniData development
environment.
RedBack 4 now introduces the option of Remote Procedure Calls (RPC) which allows the user to
make requests to RedBack outside of the RBO model. This may prove useful if the user needs to
generate recordset output but where the data can not be retrieved from a simple SELECT state-
ment. For more details please see Appendix B, RedBack Remote Procedure Calls in the “Develop-
ing With RBOs” manual.
RedPages 21
Chapter 2 - Introduction
uObject
uQuery
sbObject
RBO
The RBO class is the superclass for all the RedBack Business Object classes.
emailObject
The emailObject class is a subclass of RBO. This class provides properties and methods to allow
email messages to be sent from the Application Server.
SysInfo
The SysInfo class is a subclass of RBO. This class provides properties and methods to obtain
information about the operating system, database platform and RedBack installation.
uObject
The uObject class is a subclass of RBO. This class provides properties and methods to facilitate
access to uniVerse and UniData databases. Typically, any classes that need to read/write data will
inherit from this class.
22 RedPages
What are RedBack Business Objects?
uQuery
The uQuery class is a subclass of uObject. This class provides properties and methods to enable
queries to be run against uniVerse and UniData databases.
sbObject
The sbObject class is a subclass of RBO. This class is used to interact with SB+ applications.
RBOs are stored on the uniVerse/UniData backend and RedBack is the vehicle used to retrieve,
store or update data associated with RBOs.
For example, you may want to create an RBO called “Employee”. The Employee RBO might con-
tain the employee’s name, street address, starting date etc.
Note
See the “Developing With RBOs” manual for information about building RBOs.
RedPages 23
Chapter 2 - Introduction
Session object
ASP provides a Session object that stores each users state on the web server. The ASP page has
access to this state and you should use it store data, handles etc. that you will need on subsequent
web server submits both for the same page and other pages.
Care should be taken when using the Session object, as it has been found to result in high memory
usage on the Web Server. Applications where high hits are expected may be better served by not
using Session objects at all.
Note
Due to memory management issues with Microsoft Internet Information Server version 4 and ear-
lier, the RBODemo application no longer uses the ASP session object as it has been observed to be
inefficient.
Program Example
If IsObject(Session("EmpObj")) then
' Not first time - already have Employee object
Set oEmp = Session("EmpObj")
End If
First the page checks to see if we have EmpObj in the Session object. If we do then we have
already created it and we can retrieve it from Session and set oEmp with its value.
After creating oEmp for the first time it is stored in Session so that subsequent page submits to the
web server can retrieve it, for example,
Program Example
24 RedPages
Session object
The Session object can also be used to store other information. For example, the EmpLookup.asp
example page, stores the recordset handle and also the current page number
Program Example
RedPages 25
Chapter 2 - Introduction
Limitations
There is a maximum of 1024 fields that can be returned in a recordset.
There is a maximum of 512 accounts that can be setup in the rgw.ini file.
A hostname cannot be longer than 256 characters.
26 RedPages
Chapter 3 - Using
RedPages
This chapter provides an overview of using RedPages (RedBack aware Active Server Pages) with
RedBack.
RedPages 27
Chapter 3 - Using RedPages
Introduction
As previously mentioned , the RedPages ActiveX component provides an ADO interface to the
RedBack host server (RBO Server). ADO is designed to a be a generic interface to retrieve and
update data on a host via recordset objects. These recordset objects normally deal with the result of
a query on a database table.
This is not the ideal interface for manipulating data that has not been produced as the result of a
query. For example, a read on an Employee record. For this reason, RedPages provides an interface
to ADO through its RedObject class available from the ASP page on the web server.
The RedObject class is an additional class to make the task of interfacing to a non-query RBO
easier and more intuitive. It is not necessary to use RedObjects to make full use of the RedPages
functionality, as ADO is still supported, but we recommend you use this object.
Where the data has come from a query, then a RecordSet will be created. The RecordSet allows the
code to move through the rows of data returned from the server, and get/set properties for the cur-
rent row. Pages of data can be retrieved and then scrolled through and the result can is often dis-
played in a report or lookup.
In addition to RedObject, RedPages provides two other classes called RedSet and RedField.
RedSet objects allow you to store information in the same manner as a RecordSet but without hav-
ing a connection to any physical RBO on the RBO server.
The RedSet can be used to store multi-dimensional data on the client without the requirement of
updating state in a server RBO. For example, the RBODemo shoe store uses a RedSet to store the
contents of the basket. Rather than update a Basket RBO on the server each time a shoe is added to
the basket, this information is stored on the web server using a RedSet object. This greatly reduces
the need to "hit" the server and results in faster pages.
RedField objects allow for easy manipulation of dynamic multi-valued strings within the scripting
language. RedField also provides other useful string functions that the Universe/UniData Basic
programmer is familiar with.
For details on the properties and methods of RedObject see “RedObject” on page 30, for details
on the properties and methods of RedSet see “RedSet Object” on page 43, and for details on the
properties and methods of RedField see “RedField Object” on page 55.
28 RedPages
Introduction
The following diagram shows the RedPages components in relation to ASP and ADO:
RedPages
IIS Web
Server ADO.Connection
ADO.Command
RedPages RedBack
OLEDB Application
Provider Server
RedObject (RBOs)
(RBO)
ASP ADO
RedSet
(local)
RedField
RedObject
This exposes the properties and methods of RBOs to ASP. The EMPMAINT.ASP supplied with
the RBOdemo demonstration project supplied with RedBack is an example of using RedObject.
RedSet
This is used to create temporary record storage. To use this you simply define a number of fields,
open the recordset and edit as required. A good example of this can be found in the shopping bas-
ket in the RBOdemo demonstration project (see BASKET.ASP).
RedField
This is used to manipulate multivalue data/strings. A number of the ASP files in the RBOdemo
demonstration project supplied with RedBack use RedField. See, for example, EMPMAINT.ASP.
RedPages 29
Chapter 3 - Using RedPages
RedObject
RedObject provides a simple interface for manipulating objects and their properties and is recom-
mended instead of using ADO directly. RedObject still uses an ADO connection object to connect
to the host and returns standard ADO recordsets for uQuery selects. For other RBO classes, the
RedObject object keeps the state of all the properties of the RBO and application developers use
standard object methodology to get/set these properties.
Note
The RedObject class does not add any new functionality to RedPages. RedObject represents an
alternative way to create and manipulate RBO objects from the client.
RedObject Properties
Properties Access
Account rw
ActiveConnection rw
Errors r
Password rw
Property rw
RBOClass rw
RBOHandle rw
SessionID rw
UserID rw
Account Property
Description
This is the name of the uniVerse or UniData account.
30 RedPages
RedObject
Syntax
handle.Account = AccountName
sAccount = handle.Account
ActiveConnection Property
Description
This is the handle to an ADO connection object that must have been created prior to creation of
this RedObject object. An ADO connection object needs only be created once per account that
you are connecting to.
Note
This property has been superceded by the Account, UserID, and Password properties and the
Open2 method in release 3.2.3 of RedBack.
Syntax
handle.ActiveConnection = oConnect
oConnect = handle.ActiveConnection
RedPages 31
Chapter 3 - Using RedPages
Errors Property
Description
This property returns the ADO Errors collection. The Errors collection contains any errors that
may have been generated during an operation (see Microsoft documentation regarding ADO
objects for more information).
Syntax
aErrors = handle.Errors
Password Property
Description
This is the password for the user name specified in the UserID property.
Syntax
handle.Password = "Jupiter10"
Property Property
Description
This is the property to use to get/set any of the RBO properties. As it is the default property of the
RedObject class, the Property may be omitted.
Syntax
handle("PropName") = value
Note
Due to issues relating to VBScript it is recommended that handle("propname").Value = Value be
used.
or
handle.Property("propname") = value
32 RedPages
RedObject
value = handle("propname")
or
value = handle.Property("propname")
RBOClass Property
Description
This is the class name of the RBO object that you want instantiated on the host (for which this
RedObject object is the client proxy for).
Syntax
handle.RBOClass = RBOClass
RBOClass = handle.RBOClass
RBOHandle Property
Description
If you have a handle to an exisiting host RBO object and wish to access its properties or methods,
then set this property to that handle (instead of setting the RBOClass property). You may get such
a handle as a results of getting a property value on another object.
Syntax
handle.RBOHandle = value
value = handle.RBOHandle
SessionID Property
Description
This is the Session Id generated by RedBack on the application server (normally when the first
request is made). Once you have a session Id, you should use if for all subsequent requests (passed
as a parameter in the Open2 method. This will associate all RBO instances for a user and allow the
RBOs.
RedPages 33
Chapter 3 - Using RedPages
Syntax
handle.SessionId = value
value = handle.SessionId
UserID Property
Description
This is the user name to use when accessing a uniVerse or UniData account and RBO that has
secruity restrictions applied to it.
Note
There currently is no mechanism to apply security restrictions to an account. This property is pro-
vided for when that functionality becomes available.
Syntax
handle.UserID = UserName
sUser = handle.UserID
34 RedPages
RedObject
RedObject Methods
Methods
Open
Open2
CallMethod
Close
Open Method
Description
This is used to physically create the object on the host computer. Once this method has been called,
all the initial property values are available to query / set and host methods may be called. The
ActiveConnection, RBOClass and RBOHandle property values may optionally be passed to the
Open call. If not, they must be set before this method is called else it will fail.
Note
This method was superceded by the Open2 method in release 3.2.3 of RedBack.
Syntax
handle.Open([oConnect], [RBOClass/RBOHandle])
Open2 Method
Description
This is used to physically create the object on the host computer. Once this method has been called,
all the initial property values are avilable to query/set and the host methods may be called. This
method should be used in preference to the Open method. It performs the same operation as the
Open method but encapsulates the creation of an ADO Connection object that would otherwise
need to be supplied in the ActiveConnection property.
RedPages 35
Chapter 3 - Using RedPages
The Open2 method also allows client user session information to be saved on the RBO Server and
therefore alleviates session management on the web server which may sometimes be a perfor-
mance issue. To update client user session information to the RBO Server, the ReCalc method is
recommended or any user defined method will also update the client session information to the
RBO Server on execution.To restore an object’s session information the Open2 method must be
called using a valid RBOHandle or valid session id. The RBOHandle is the only user session infor-
mation that needs to be stored by the client (in a browser cookie for example). Please see the
RBODemo Shoe Store application for an example.
Warning
The RBODemo application is an example demonstration only and real world applications will
require different considerations and methodologies.
Note
The user login and user password arguments are only used by the RedBack RBOScope applica-
tion.
Syntax
Handle.Open2([Account], [RBOClass|RBOHandle], [User], [Password], [SessionId])
CallMethod Method
Description
This is used to call a method of the RBO.
Syntax
obj = handle.CallMethod(MethodName)
Where:
• obj is equal to null for any method other than Select on a uQuery object.
• Select method returns an ADO recordset.
36 RedPages
RedObject
• the session id should be passed with every Open2 method call as it will associate the cur-
rent RBO with previously created RBO’s within that session instance. It is recommended
that you preserve the session id after you create the first RBO so that it can be used in each
subsequent Open2 method call.
Close Method
Description
This is used to close the object. Closing the object releases all resources associated with the RBO
object on the client. The object may be reused by either re-opening the RBO object or by specify-
ing a new RBOClass/RBOHandle and then calling Open2 again.
Syntax
handle.Close
RedPages 37
Chapter 3 - Using RedPages
Syntax
Preferred Method
handle.Open2 Account RBOClass/RBOHandle
Alternatively, it is possible to specify the following sequence:
handle.Account = Account
handle.RBOClass = RBOClass
handle.Open2
38 RedPages
Step-by-Step Instructions for Using RedObject
Alternate Method
handle.Open oConnect, RBOClass
Alternately, you may do the following:
handle.ActiveConnection = oConnect
handle.RBOClass = RBOClass
handle.Open
Program Example
RedPages 39
Chapter 3 - Using RedPages
Destroy object
Syntax
There are three steps.
Firstly it is necessary to notify the RedBack backend to destroy the RBO. The syntax to do this is:
handle.CallMethod(“Destroy”)
Next it is necessary to make the RedObject release all resources beying used by RedObject. The
syntax to do this is:
handle.Close
Finally, it is necessary to notify the Microsoft IIS to release all resources associated with RedOb-
ject. The syntax to do this is:
Set handle = Nothing
Program Example
oEmp.CallMethod("Destroy")
oEmp.Close
Set oEmp = Nothing
40 RedPages
RedObject Code Example
Program Example
<HTML>
<HEAD>
<TITLE>RedPages RedObject Example</TITLE>
</HEAD>
<BODY>
<%
On error Resume Next
'2. Attach the Employee RBO to this local object, at the same time
'setting the account details
'
oEmp.Open2 "RBODemo", "OFFICE:Employee"
'3. Now we can specify the read. First we set the EmpId value in the
'RedObject, this is because with RedObjects, all changed data will be
'sent to the server, rather than the page having to specify each data
'element individually. Note: ASP has problems assigning values to a
'default property so we have to explicitly specify the Value property.
'
'
oEmp("EmpId").Value = Request.QueryString("EmpId")
oEmp("EmpId").Value = "1002"' Hard coded for test run
oEmp.callMethod "ReadData"
'5. Now in order to get the property values you would do the following
'
FirstName = oEmp("FirstName")
LastName = oEmp("LastName")
Response.Write ("First Name=" & FirstName & " LastName=" & LastName)
'6. Destroy the object when finished with it. This releases any resources
RedPages 41
Chapter 3 - Using RedPages
'that it uses.
'
oEmp.CallMethod("Destroy")
oEmp.Close
Set oEmp = Nothing
%>
</BODY>
</HTML>
See “EmpMaint.asp” on page 110 for a complete listing of the program example sup-
plied with RBOdemo.
42 RedPages
RedSet Object
RedSet Object
RedSet provides a mechanism to create your own local objects to save state or record information.
RedSet does not make any connection to the backend but keeps the state of the object in memory.
RedSet Properties
Properties Access
AbsolutePosition rw
BOF r
EOF r
Property rw
RecordCount r
AbsolutePosition Property
Specifies the ordinal position of a RedSet object's current record.
Syntax
handle.AbsolutePosition = 2
pos = handle.AbsolutePosition
Constant Description
adPosUnknown(-1)
The Recordset is empty, the current position is unknown.
RedPages 43
Chapter 3 - Using RedPages
adPosBOF(-2)
The current record pointer is at BOF (that is, the BOF property is True).
adPosEOF(-3)
The current record pointer is at EOF (that is, the EOF property is True).
Remarks
Use the AbsolutePosition property to move to a record based on its ordinal position in the RedSet
object, or to determine the ordinal position of the current record.
AbsolutePosition is 1-based and equals 1 when the current record is the first record in the RedSet.
You can obtain the total number of records in the RedSet object from the RecordCount property.
You should not use the AbsolutePosition property as a surrogate record number.
The position of a given record changes when you delete a preceding record.
Syntax
If handle.BOF then ...
Return Value
The BOF and EOF properties return Boolean values.
Remarks
Use the BOF and EOF properties to determine whether a RedSet object contains records or
whether you've gone beyond the limits of a RedSet object when you move from record to record.
The BOF property returns True (-1) if the current record position is before the first record and
False (0) if the current record position is on or after the first record.
44 RedPages
RedSet Object
The EOF property returns True if the current record position is after the last record and False if the
current record position is on or before the last record.
If either the BOF or EOF property is True, there is no current record.
When you first open the RedSet, the BOF and EOF properties are set to True, and the Recordset
object's RecordCount property setting is zero.
If you delete the last remaining record, the BOF and EOF properties may remain False until you
attempt to reposition the current record.
This table shows which Move methods are allowed with different combinations of the BOF and
EOF properties.
Allowing a Move method doesn't guarantee that the method will successfully locate a record; it
only means that calling the specified Move method won't generate an error.
The following table shows what happens to the BOF and EOF property settings when you call
various Move methods but are unable to successfully locate a record.
BOF EOF
MoveFirst, MoveLast Set to True Set to True
RedPages 45
Chapter 3 - Using RedPages
BOF EOF
Move 0 No change No change
MovePrevious, Move < 0 Set to True No change
MoveNext, Move > 0 No change Set to True
Property Property
Description
This is the property to use to get/set any of the properies in the RedSet Object. As it is the default
property of the RedSet class, the Property word may be omitted.
Syntax
handle("propname") = value
value = handle("propname")
Or
value = handle.Property("propname")
handle("propname").Property = value
Note
Due to issues relating to VBScript it is recommended that handle("propname").value be used
when setting a property value.
RecordCount Property
Indicates the current number of records in a RedSet object.
Syntax
count = handle.RecordCount
46 RedPages
RedSet Object
Return Value
Returns a Long value.
Remarks
Use the RecordCount property to find out how many records are in a RedSet object.
The property returns -1 when ADO cannot determine the number of records. Reading the
RecordCount property on a closed RedSet causes an error.
RedSet Methods
Methods
AddNew
Close
Delete
Move
MoveFirst
MoveLast
MoveNext
MovePrevious
Open
AddNew Method
Creates a new record in the RedSet object.
Syntax
handle.AddNew FieldList, Values
RedPages 47
Chapter 3 - Using RedPages
Parameters
FieldList
Optional. A single name, or an array of names or ordinal positions of the fields in the new record.
Values
Optional. A single value, or an array of values for the fields in the new record. If Fields is an array,
Values must also be an array with the same number of members; otherwise, an error occurs. The
order of field names must match the order of field values in each array.
Remarks
Use the AddNew method to create and initialize a new record.
After you call the AddNew method, the new record becomes the current record.
Close Method
Closes an open object and any dependent objects.
Syntax
handle.Close
Remarks
Use the Close method to close a RedSet object to free any associated system resources. Closing an
object does not remove it from memory; you can still open it again later. To completely eliminate
an object from memory, set the object variable to Nothing.
Delete Method
Deletes the current record.
Syntax
handle.Delete
48 RedPages
RedSet Object
Move Method
Moves the position of the current record in a RedSet object.
Syntax
handle.Move NumRecords, Start
Parameters
NumRecords
Signed Long expression specifying the number of records the current record position moves.
Start
Optional. One of the following BookmarkEnum values:
adBookmarkCurrent
Default. Start at the current record.
AdBookmarkFirst
Start at the first record.
adBookmarkLast
Start at the last record.
Remarks
If the NumRecords argument is greater than zero, the current record position moves forward
(toward the end of the RedSet). If NumRecords is less than zero, the current record position moves
backward (toward the beginning of the RedSet).
If the Move call would move the current record position to a point before the first record, ADO sets
the current record to the position before the first record in the RedSet (BOF is True). An attempt
to move backward when the BOF property is already True generates an error.
If the Move call would move the current record position to a point after the last record, ADO sets
the current record to the position after the last record in the RedSet (EOF is True). An attempt to
move forward when the EOF property is already True generates an error.
Calling the Move method from an empty RedSet object generates an error.
RedPages 49
Chapter 3 - Using RedPages
If you pass the Start argument, the move is relative to the record with this.
Syntax
handle.{MoveFirst | MoveLast | MoveNext | MovePrevious}
Remarks
Use the MoveFirst method to move the current record position to the first record in the RedSet.
Use the MoveLast method to move the current record position to the last record in the RedSet.
Use the MoveNext method to move the current record position one record forward (toward the
bottom of the RedSet). If the last record is the current record and you call the MoveNext method,
ADO sets the current record to the position after the last record in the RedSet (EOF is True). An
attempt to move forward when the EOF property is already True generates an error.
Use the MovePrevious method to move the current record position one record backward (toward
the top of the RedSet).
Open Method
Opens a RedSet object. The field list passed to the Open method defines the fields that will be cre-
ated in the internal ADORecordset object.
Syntax
handle.Open fieldlist
Where fieldlist is a comma separated list of names of properties the object should support.
Remarks
Initially the RedSet object is created with no records. No other operation is permitted until the
Open method has been called to define the RedSet.
50 RedPages
Step-by-Step Instructions for Using RedSet
Syntax
handle = Server.CreateObject("RedBack.RedSet")
Syntax
handle.Open fieldlist
Where fieldlist is a comma separated list of names of properties the object should support.
RedPages 51
Chapter 3 - Using RedPages
Syntax
handle.AddNew
Syntax
handle.{MoveFirst | MoveLast | MoveNext | MovePrevious}
52 RedPages
RedSet Code Example
Program Example
<HTML>
<HEAD>
<TITLE>RedPages RedSet Example</TITLE>
</HEAD>
<BODY>
<%
On error Resume Next
'2. Next Open the RedSet object and define the properties or fields it will
'support.
'
oSet.Open "Name, PhoneNo"
RedPages 53
Chapter 3 - Using RedPages
54 RedPages
RedField Object
RedField Object
RedField is a nested data structure, that can represent uniVerse/UniData nested data-base fields. It
is limited to two levels of nesting.
Note
chr(253) and chr(252) are the default values for ValueMarker and SubValueMarker. It is possible
to change these values using the ValueMark property.
Access to each of the two levels uses a syntax similar to that found in the uniVerse/UniData
BASIC language, with nesting operators: .Value and .SubValue. In this section, the notation [.Nest-
ingOp] is used to represent one of the following nesting operators:
[.NestingOp] = .Value(ValueIndex) |
.SubValue(ValueIndex, SubValueIndex) ]
Program Example
RedPages 55
Chapter 3 - Using RedPages
RedField Properties
Properties Access
count r
length r
StringValue rw
ValueMark rw
count Property
Description
Returns the number of values, or subvalues contained in the specified portion of the object.
Syntax
RedField[.NestingOp].count
Part Description
[.NestingOp] Can be:
• Value(ValueIndex)
ValueIndex Can be:
• between 1 and RedField.count to specify a value position.
• -1 to specify the last value position; equivalent to Red-
Field.Value(RedField.count)
56 RedPages
RedField Object
Remarks
If .NestingOp is omitted, count returns the number of values in the object.
If .NestingOp is .Value(v), count returns the number of subvalues in value ‘v’.
If .NestingOp is .SubValue(v, s), count always returns 0.
length Property
Description
Returns the string length contained in the specified portion of the object.
Syntax
RedField[.NestingOp].length
Part Description
[.NestingOp] Can be either:
• .Value(ValueIndex)
• .SubValue(ValueIndex,SubValueIndex)
ValueIndex Can be:
• between 1 and RedField.count to specify a value position.
• -1 to specify the last value position; equivalent to
RedField.Value(RedField.count).length
SubValueIndex Can be:
• between 1 and RedField.Value(v).count to specify a sub-
value position within value ‘v’.
• -1 to specify the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count).len
gth
RedPages 57
Chapter 3 - Using RedPages
Remarks
If .NestingOp is omitted, length returns the total number of characters in the object, counting each
ValueMarker, and SubValueMarker delimiter as 1.
If .NestingOp is .Value(v), length returns the number of characters in value ‘v’ including any
SubValueMarker delimiters.
If .NestingOp is .SubValue(v,s), length returns the number of characters in subvalue ‘s’ of value
‘v’.
58 RedPages
RedField Object
StringValue Property
Description
This sets or returns in string format, the contents of the specified portion of a RedField object. If
the portion already contains a string it is replaced.
Syntax
RedField[.NestingOp][.StringValue] [=String]
Part Description
[.NestingOp] Can be either:
• .Value(ValueIndex)
• .SubValue(ValueIndex,SubValueIndex)
ValueIndex Can be:
• an integer that specifies a value position.
• -1 to specify the last value position; equivalent to
RedField.Value(RedField.count+1).StringValue
meaning replace the last value.
SubValueIndex Can be:
• an integer that specifies a subvalue position within value ‘v’.
• -1 to specify the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count).S
tringValue
meaning replace the last subvalue.
If .NestingOp is omitted, the entire contents of the RedField object are set to String.
If .NestingOp is .Value(v), the String is set in the value ‘v’.
If .NestingOp is .SubValue(v,s), the String is set in the subvalue ‘s’ of value ‘v’.
RedPages 59
Chapter 3 - Using RedPages
Property ValueMark
Description
This property gets or sets the current integer value that is used to delimit values within a dynamic
string by the RedField object. The SubValueMark is always automatically calculated as the value
for ValueMark-1.
Syntax
Redfield.ValueMark = Integer
where:
Integer
is a number which represents the ASCII character.
60 RedPages
RedField Object
RedField Methods
Methods
Del
Ins
Replace
SwapString
SubValue
Value
Del Method
Description
This deletes an element (Value or SubValue) from the specified portion of the RedField object.
Syntax
RedField[.NestingOp].Del
Part Description
[.NestingOp] Can be either:
• .Value(ValueIndex)
• .SubValue(ValueIndex,SubValueIndex)
RedPages 61
Chapter 3 - Using RedPages
Part Description
ValueIndex Can be:
• between 1 and RedField.count to delete a nominated value
position.
• -1 to delete the last value position; equivalent to
RedField.Value(RedField.count).Del
SubValueIndex Can be:
• between 1 and RedField.Value(v).count to delete a nomi-
nated subvalue position within value ‘v’.
• -1 to specify the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count).De
l
Remarks
If .NestingOp is omitted, the entire contents of the RedField object are deleted.
Zero (0) values of ValueIndex and SubValueIndex are automatically translated to 1.
62 RedPages
RedField Object
Ins Method
Description
This inserts an element (Value or SubValue) into the specified portion of the RedField object.
Syntax
RedField[.NestingOp].Ins [String]
Part Description
[.NestingOp] Can be either:
• .Value(ValueIndex)
• .SubValue(ValueIndex,SubValueIndex)
ValueIndex Can be:
• between 1 and RedField.count+1 to insert a nominated
value position.
• -1 to append after the last value position; equivalent to
RedField.Value(RedField.count).Ins
SubValueIndex Can be:
• between 1 and (RedField.Value(v).count+1) to insert a
nominated subvalue position within value ‘v’.
• -1 to append after the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count+1)
.Ins
String The contents of the element to be inserted.
Remarks
After insertion, all other elements after the position specified will be increased by 1.
RedPages 63
Chapter 3 - Using RedPages
If .NestingOp is omitted, the entire contents of the RedField object are replaced with String.
Zero (0) values of ValueIndex and SubValueIndex are automatically translated to 1.
If String is omitted, a NULL string (i.e. "") is inserted.
If an insertion is done into an empty or NULL string position the String simply replaces the null
wihout inserting a new value or subvalue.
64 RedPages
RedField Object
Replace Method
Description
This replaces an element (Value or SubValue) from the specified portion of the RedField object.
Syntax
RedField[.NestingOp].Replace [String]
Part Description
[.NestingOp] Can be either:
• .Value(ValueIndex)
• .SubValue(ValueIndex,SubValueIndex)
ValueIndex Can be:
• between 1 and RedField.count to replace a nominated
value position.
• -1 to delete the last value position; equivalent to
RedField.Value(RedField.count).Replace
SubValueIndex Can be:
• between 1 and RedField.Value(v).count to replace a nomi-
nated subvalue position within value ‘v’.
• -1 to specify the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count).R
eplace
String The new contents of the element to be replaced.
Remarks
If .NestingOp is omitted, the entire contents of the RedField object are replaced.
RedPages 65
Chapter 3 - Using RedPages
66 RedPages
RedField Object
SwapString
Description
This method is used on an initial string to replace all occurrences of one substring with another
substring.
Syntax
newstr = RedField.SwapString(oldstr,origseq,newseq)
This syntax has the following parts:
Part Description
oldstr The string that is to have its substrings swopped.
origseq The sequence of characters to be replaced.
newseq The sequence of characters to replace the origseq with.
Remarks
origseq and newseq are strings so if you wish to replace a single character they should still be
passed as a string i.e. to replace all character ‘A’ with the character ‘B’ you would do a
SwapString(mystring,"A","B").
Note
The SwapString method has no effect on the current contents of the RedField object.
RedPages 67
Chapter 3 - Using RedPages
SubValue Method
Description
This is a nesting operator to access a specific subvalue, when combined with another property or
method.
Syntax
RedField.SubValue(ValueIndex,SubValueIndex)
Part Description
ValueIndex Can be:
• between 1 and RedField.count to specify an existing value
position.
• -1 to specify the last value positioin; equivalent to
RedField.Value(RedField.count)
• -1 or (RedField.count+1) to specify a new value position
after the last one; used to insert new values with Insert or
StringValue
SubValueIndex Can be:
• between 1 and RedField.Value(v).count to specify an
existing subvalue position within value ‘v’.
• -1 to specify the last subvalue position; equivalent to
RedField.SubValue(v,RedField.Value(v).count)
• -1 or (RedField.Value(v).count+1) to specify a new
subvalue position after the last one; used to insert new subval-
ues with Insert or StringValue
Remarks
Zero (0) values of ValueIndex and SubValueIndex are automatically translated to 1.
68 RedPages
RedField Object
SubValue must be combined with another property or method, otherwise it porduces an invalid
object.
RedPages 69
Chapter 3 - Using RedPages
Value Method
Description
This is a nesting operator which is used to access a specific value, when combined with another
property or method.
Syntax
RedField.Value(ValueIndex)
Part Description
ValueIndex Can be:
• between 1 and RedField.count to specify an existing value
position.
• -1 or (RedField.count+1) to specify the last value posi-
tion; used to insert new fields with Insert or StringValue
SubValueIndex Can be:
• between 1 and RedField.Value(v).count to specify an
existing value position.
• -1 to specify the last value position; equivalent to
RedField.Value(RedField.count)
• -1 or (RedField.count+1) to specify a new value position
after the last one; used to insert new values with Insert or
StringValue
Remarks
Zero (0) values of ValueIndex are automatically translated to 1.
Value must be combined with another property or method, otherwise it produces an invalid object.
70 RedPages
Step-by-Step Instructions for Using RedField
Syntax
handle = Server.CreateObject("RedBack.RedField")
Syntax
handle.StringValue = dynastring
or
handle.Replace dynastring
or
handle.Ins dynastring
or
handle.Append dynastring
RedPages 71
Chapter 3 - Using RedPages
Syntax
To insert element at Value position 2:
handle.Value(2).Ins StringValue
To delete SubValue 3 of Value 1:
handle.SubValue(1,3).Del
To add a new SubValue to the end of Value 2
handle.SubValue(2, -1).Append
Syntax
dynastring = handle
Syntax
handle.StringValue = ""
Set handle = Nothing
72 RedPages
RedField Code Example
Program Example
<HTML>
<HEAD>
<TITLE>RedPages RedField Example</TITLE>
</HEAD>
<BODY>
<%
On error Resume Next
'2. Create our initial string. A list of names and item counts and convert
'the ':' and ',' separators into SubValue and Value Marks.
'
mystring = "Colin:100,Jurgen:205,Tony:313,Mike:400"
mystring = oFld.SwapString(mystring, ":", chr(252))
mystring = oFld.SwapString(mystring, ",", chr(253))
'3. Assign the string to the RedField. Note: ASP has trouble making an
'assignment to a default property so we have to specify StringValue
'explicitly.
'
oFld.StringValue = mystring
count = count + 1
Wend
'5. Insert a new person between Jurgen and Tony. Note: ASP has trouble
RedPages 73
Chapter 3 - Using RedPages
'7. Extract the dynamic string and convert back to the original
'format.
'
mystring = oFld.SwapString(oFld, chr(253), ",")
mystring = oFld.SwapString(mystring, chr(252), ":")
Response.Write(mystring)
74 RedPages
ADO Object
ADO Object
ADO Object Model
This can be found at the following location:
http://msdn.microsoft.com/library/techart/adosql_2.htm
Note
This location is not maintained by Informix Software Corp and may be subject to change without
notice.
Note
This location is not maintained by Informix Software Corp and may be subject to change without
notice.
RedPages 75
Chapter 3 - Using RedPages
Note
Using collections, methods and properties of a Connection object, you can examine errors returned
from the data source with the Errors collection.
The provider is the RedBack component (redpages.dll) which provides access to the uni-
Verse/UniData backend. This is done in the following manner
Syntax
Set connectionobjectname = Server.CreateObject("ADODB.Connection")
connectionobjectname.Provider = "RedBack.RedPages"
connectionobjectname.Open Accountname
76 RedPages
Step-by-Step Instructions for Using ADO
where:
Accountname
Optional. Denotes the name of the uniVerse or UniData account.
This can have a number of formats:
1, Accountname
This is a name given to represent a U2 (i.e. uniVerse or UniData) account. This name corre-
sponds to an entry in the rgw.ini file which maps the name to an IP address and port number
(see “rgw.ini” on page 122 for more information about this ini file).
2, IPaddress:portnumber
This format specifies the IP number for the host machine and the port number to be used to
communicate with the specific account.
Program Example
RedPages 77
Chapter 3 - Using RedPages
Program Example
parameters
These can take one of the following forms:
("Inputfieldname1=Value1","Inputfieldname2=Value2",...)
("Inputfieldname1=Value1", "Outputfieldname1","Outputfieldname2"...)
methodname
The exact methods which can be called will depend on the design of the RedBack Business Object
(RBO). The RBO is an object with a set of methods associated with it. These are created by the
application programmer via the RedBack Explorer. Therefore the actual method names available
will be determined by the application programmer.
78 RedPages
Step-by-Step Instructions for Using ADO
Program Example
rbo.CommandText = "OFFICE:Employee.Create()"
rbo.CommandText = "ReadData(EmpId=" & Request.QueryString("EmpId")& ")"
Note
To invoke rbo.CommandText it is necessary to invoke:
Program Example
In general field values are a single data value i.e. Employee="Colin". A feature of the uni-
Verse/UniData databases is that any data field can contain nested or multivalued data. Each field
may be made up of 1 or more ‘values’ and each value may be made up of 1 or more ‘subvalues’.
The string returned from the ‘field value’ operation above will contain all of this nested data in
what is referred to as a dynamic string.
To assist extraction, creation and manipulation of dynamic strings redpages.dll also registers an
object titled RedField. The RedField object provides a simple mechanism for working with
dynamic strings (see “RedField Object” on page 55).
RedPages 79
Chapter 3 - Using RedPages
Destroy objects
Syntax
Set RedBackBusinessObjectName = Nothing
Program Example
80 RedPages
ADO Code Examples
Program Example
<HTML>
<HEAD>
<TITLE>RedPages ADO Read Example</TITLE>
</HEAD>
<BODY>
<%
On error Resume Next
'Note in VBScript there is no need to use the Dim statement for local
'variables
'Note RBO is used as an abbreviation to denote "RedBack Business Object"
'
'1. Create the ADO connection object, set the provider and Open the account
'
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.Provider = "RedBack.RedPages"
objconn.Open "RBODemo"
'2. Now we need a command object for the RBO we are going to reference. It is
'through this object that each RBO server request is made. The Command
'object is passed the ADO Connection object so it knows where to connect
'with each of its requests
'
Set rbo = Server.CreateObject("ADODB.Command")
rbo.ActiveConnection = objconn
'3. Now we can tell the command object to create an instance of a RBO on the
'RBO server. We do this by assigning the required method call to the
'command object's "command" string and then executing it.
'
rbo.CommandText = "OFFICE:Employee.Create()"
rbo.Execute
RedPages 81
Chapter 3 - Using RedPages
'5. Now do a ReadData, passing in the EmpId value of "1010". Each name/value
'that is to be sent back has to be placed as an argument to the method
'call The "Set employee" statement will assign the resulting recordset
'(from the execute) to the variable "employee"
'
EmpId = Request.QueryString("EmpId")
EmpId = 1010 ' hard coded for test purposes
rbo.CommandText = "ReadData(EmpId=" & EmpId & ")"
Set employee = rbo.Execute
'6. Now we can retrieve the required property values from the recordset.
'
FirstName = employee("FirstName")
LastName = employee("LastName")
Response.Write("FirstName=" & FirstName & " LastName=" & LastName)
'7. If we want to reuse the Connection and Command objects for reuse in
'another ASP page then we can save them as follows:
'
Set Session("connectionvariablename") = objconn
Set Session("rbovariablename") = rbo
Write Example
The following code is a typical example of a RedBack RedPage which performs a write action.
Program Example
<HTML>
<HEAD>
<TITLE>RedPages ADO Write Example</TITLE>
82 RedPages
ADO Code Examples
</HEAD>
<BODY>
<%
On error Resume Next
'Note in VBScript there is no need to use the Dim statement for local
'variables
'Note RBO is used as an abbreviation to denote "RedBack Business Object"
'
'1. Create the ADO connection object, set the provider and Open the account
'If we want to reuse the Connection object from the Read example we would
'insert the following code instead of the next 3 lines:
'Set objconn = Session("connectionvariablename")
'
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.Provider = "RedBack.RedPages"
objconn.Open "RBODemo"
'2. Now we need a command object for the RBO we are going to reference. It is
'through this object that each RBO server request is made. The Command
'object is passed the ADO Connection object so it knows where to connect
'with each of its requests
'
Set rbo = Server.CreateObject("ADODB.Command")
rbo.ActiveConnection = objconn
'3. Now we can tell the command object to create an instance of a RBO on the
'RBO server. We do this by assigning the required method call to the
'command object's "command" string and then executing it.
'
rbo.CommandText = "OFFICE:Employee.Create()"
rbo.Execute
'5. Now do a ReadData, passing in the EmpId value of "1010". Each name/value
'that is to be sent back has to be placed as an argument to the method
'call The "Set employee" statement will assign the resulting recordset
'(from the execute) to the variable "employee"
'
EmpId = Request.Form("EmpId")
Name = Request.Form("FirstName")
EmpId = 1010 ' hard coded for test purposes
Name = "Nghia La"
rbo.CommandText = "WriteData(EmpId=" & EmpId & ",FirstName=" & Name & ")"
Set employee = rbo.Execute
RedPages 83
Chapter 3 - Using RedPages
'6. If we want to reuse the Connection and Command objects for reuse in
'another ASP page then we can save them as follows:
'
Set Session("connectionvariablename") = objconn
Set Session("rbovariablename") = rbo
<HTML>
<HEAD>
<TITLE>RedPages Recordset Example</TITLE>
</HEAD>
<BODY>
<%
On error Resume Next
84 RedPages
ADO Code Examples
'Now that we have the first page we can get and set values for that
'page, that tell us how many items were selected and what the page
'size is (determined by the RBO from the class definition).
'
pageSize = oLookup("items_per_page")
rs.PageSize = pageSize
max = oLookup("MaxRows")
pageCount = Int(max/pageSize)
If max Mod pageSize then
pageCount = pageCount + 1
End if
RedPages 85
Chapter 3 - Using RedPages
End if
Next
</BODY>
</HTML>
86 RedPages
Error Handling
Error Handling
When writing ASP applications that communicate via ADO to data sources such as the RedPages
OLE DB provider, there is a need to handle various error conditions and messages that the provider
may generate. The mechanism for determining the success or failure of any operation is by check-
ing the ADO Errors collection associated with the Connection object.
The ADO Errors collection contains the provider-specific errors generated by a single operation.
Each Error object constitutes one such error in the collection. To get information about an error,
query the properties of an Error object from the Connection object. To get all the Error objects in
the Errors collection, use code to loop through the collection.
ADO errors (for example, invalid use of ADO properties or methods), as opposed to provider
errors (those generated by the RedPages provider), do not appear in the Errors collection. ADO
errors are captured by the exception handling mechanism of your run-time environment. For exam-
ple, in Microsoft® Visual Basic® and Microsoft® Active Server Pages®, the occurrence of an
ADO Error will trigger an On Error event and appear as a VB or ASP Err object.
If you want to trap both provider-specific errors (by querying the properties of an Error object)
and ADO errors (by trapping ADO errors through the run-time exception handler) in your applica-
tion, you have to write error-handling code for both. (See example code below)
Error numbers returned by ADO are 32-bit hexadecimal values that define the error. Each error
code consists of a number of pieces with the lower 16-bit being the actual error identifier. A nega-
tive number indicates a trappable error condition, 0 indicates success and a positive number indi-
cates an informational type status.
Any provider-specific trappable error (negative number) generated by the provider is added to the
ADO Errors collection and is also handled through the run-time exception handler.
Any provider-specific non-trappable error (positive number) generated by the provider is added to
the ADO Errors collection but is not handled by the run-time exception handler.
This means that the On Error event generated in VB or ASP will only occur for negative error
numbers. If you wish to check for non-trappable errors then you will need to examine the ADO
Errors collection.
Non-trappable error numbers usually represent a successfully completed operation but indicate
that some extra information was returned with regard to that operation.
RedPages 87
Chapter 3 - Using RedPages
A common non-trappable error in RedBack is error number 0x50040023 (See “RedBack Error
Codes” on page 127 for a list of all error codes). This error number represents an Alert generated
by the RedBack Application Server. Alerts are messages sent from the RedBack Application
Server to inform the user of something. An example of this is the Alert message generated when
you log in to a RedBack Application Server that is running with a temporary license. The message
shows how many days before the temporary license expires.
The following ASP code fragment demonstrates how to handle both trappable and non-trappable
errors. The code creates an ADO connection object and opens a connection to the rbodemo
account. It then creates a RedObject and attempts to Open a "OFFICE:Employee" object on the
server. After the Open method call we test the returned error number and either write the error
message to the page or add the Alert message to the StatusText variable.
Program Example
<HTML>
<HEAD>
<TITLE>RedPages Error handling example</TITLE>
</HEAD>
<BODY>
<%
On Error Resume Next
'
88 RedPages
Error Handling
'Gets the error Number from either the On Error Err object or ADO
'Errors collection
'Note: Err.Number is only filled in for trappable errors (negative
numbers)
'Passed: obj - The RedObject
'
Function GetErrNumber(obj)
GetErrNumber = 0
If Err.Number Then
GetErrNumber = Err.Number
Else
If not IsEmpty(obj) and IsObject(obj) Then
If obj.Errors.Count > 0 Then
GetErrNumber = obj.Errors.Item(0).Number
End If
End If
End If
End Function
'
'Gets the error Description from either the On Error Err object or
'ADO Errors collection
'Note: Err.Number is only filled in for trappable errors (negative
numbers)
'Passed: obj - The RedObject
'
Function GetErrDescription(obj)
GetErrDescription = ""
If Err.Number Then
GetErrDescription = Err.Description
Else
If not IsEmpty(obj) and IsObject(obj) Then
If obj.Errors.Count > 0 Then
GetErrDescription = obj.Errors.Item(0).Description
End If
End If
End If
End Function
%>
</BODY>
</HTML>
RedPages 89
Chapter 3 - Using RedPages
90 RedPages
Chapter 4 - RBODemo
RBODemo is a fictitious shoe store which demonstrates key features of the RedBack product.
This chapter takes you through some of the code used in the RedPages version of RBODemo.
RedPages 91
Chapter 4 - RBODemo
RBODemo
RBODemo is a demonstration program. RBODemo was built to demonstrate some of the main
features of RedBack which can be applied to the development of web-based transactional applica-
tions. You can view the code in the RBODemo application to show how these RedBack concepts
are applied.
Note
RBODemo is not a full commercial application and has purposely been kept simple to help iden-
tify and clarify RedBack concepts.
The RBODemo application is bundled with RedBack and is installed during the RedBack installa-
tion process.
RBODemo can be disabled from a live runtime system by deleting it from your system (refer to
your database documentation for further information on how to do this) or by removing references
to it in rgw.ini and rgwresp.ini (see the Administration manual for more details).
Note
Refer to the “Developing With RBOs” manual for more information about design methodology.
Design Goals
RBODemo is based on a fictional shoe store called “RedPage Shoes”. We have identified three
types of potential users for this application, these being:
• external retail customers ordering directly form the RedPages shoe store,
• external trade customers wanting to purchase shoes,
• internal staff who maintain the shoe stock records in the application, and managers who
maintain administrative records such as employee details.
The following sections provide more information about RBOdemo.
92 RedPages
RBODemo
Starting RBODemo
Type in the following URL in order to launch RBODemo:
http://web_server_name/rbodemo
where the web_server_name is either the domain name of the web server or the IP address of the
web server machine.
The following web page will be presented:
From this screen it is possible to go to the RedPages version of the shoe store by clicking on the
RedPage store link.
RedPages 93
Chapter 4 - RBODemo
Tip
It is always a good idea to design a static set of web pages to get an idea of how your application
will look.
94 RedPages
RBODemo
Retail customers click on the picture of the shoe store to gain access whereas trade customers and
staff click on the menu links provided along the left hand side of the screen.
Trade customers will be taken to Step:2 Login Page, whereas retail customers will be taken to
Step 3:Choose Shoe Category and Shoe Style.
RedPages 95
Chapter 4 - RBODemo
96 RedPages
RBODemo
RedPages 97
Chapter 4 - RBODemo
The dropdown combo box is dynamically created from data in the database..
98 RedPages
RBODemo
RedPages 99
Chapter 4 - RBODemo
100 RedPages
RBODemo
Step 6: Checkout
This is the page where the customer provides delivery details and payment information.
RedPages 101
Chapter 4 - RBODemo
102 RedPages
RBODemo
The Pages
Tip
It is always a good idea to design a static set of web pages to get an idea of how your application
will look. The following screens will take you through the employee maintenance section.
RedPages 103
Chapter 4 - RBODemo
Program Example
<HTML>
<HEAD>
<TITLE>RedPages</TITLE>
</HEAD>
<FRAMESET ROWS="120,*" BORDER=0>
<FRAME SRC="BOHead.asp" NAME="TOP" NORESIZE>
<FRAMESET COLS="18%,82%">
<FRAME SRC="BOMenu.asp" NAME="MENU" NORESIZE>
<FRAME SRC="BOMain.asp" NAME="MAIN" NORESIZE>
</FRAMESET>
104 RedPages
RBODemo
</FRAMESET>
</HTML>
RedPages 105
Chapter 4 - RBODemo
106 RedPages
RBODemo
RBO
Employees
ReadData()
WriteData()
EmpMaint.asp
Lookup
EmpLookup.asp RBO
EmpLookup
RedPages 107
Chapter 4 - RBODemo
Within the OFFICE module a number of RBOs are designed and viewed by using the RedBack
Designer:.
108 RedPages
RBODemo
The Employee RBO is particularly relevant regarding the employee maintenance portion of
RBOdemo.:
Refer to the documentation supplied with RedBack Designer for more information.
The Code
All of the user interface code is handled by the web server in RedBack aware Active Server Pages
(ASP) called RedPages. RedPages are saved using the same .asp extension as ASP and support the
same scripting languages as ASP.
The code for the user interface of the employee maintenance section of RBODemo is contained in
the following three files:
• EmpMaint.asp
• EmpLookup.asp
• CommonSubs.inc
RedPages 109
Chapter 4 - RBODemo
The ASP code is contained within tags that have a percentage symbol, i.e.
<%
%>
and is shown in bold in the code examples that follow.
The file CommonSubs.inc is simply a file that contains common routines, which are used by the
other two files.
EmpMaint.asp handles the employee maintenance routines and EmpLookup.asp handles the
lookup routines.
The code for these three files is shown below for reference purposes.
EmpMaint.asp
Program Example
<%
On error Resume Next
Const VM = "ý"
' Create two objects to hold multivalue Dept codes and descriptions
Set oCodes = Server.CreateObject("RedBack.RedField")
Set oDescs = Server.CreateObject("RedBack.RedField")
If firstTime Then
oCodes.StringValue = oEmp("DeptCodes")
oDescs.StringValue = oEmp("DeptDescs")
Else
oCodes.StringValue = Request.Form("Codes")
oDescs.StringValue = Request.Form("Descs")
End If
110 RedPages
RBODemo
%>
<!--#include file="CommonSubs.inc"-->
<%
Sub ReadData()
On error Resume Next
' First look if id passed in URL string (eg from lookup) else get from form
post
EmpId = Request.QueryString("EmpId")
If IsEmpty(EmpId) Then EmpId = Request.Form("EmpId")
' Set the propery in the object to the new value
oEmp("EmpId").Value = EmpId
' Now do the read by calling the ReadData method
oEmp.CallMethod "ReadData"
If Err.Number Then DisplayError
focusObj = "FirstName"
End Sub
RedPages 111
Chapter 4 - RBODemo
Sub WriteData()
' Update all property values in object then call WriteData method
UpdateEmp
oEmp.CallMethod "WriteData"
If Err.Number Then DisplayError
focusObj = "EmpId"
End Sub
Sub Validate()
UpdateEmp
fName = Request.QueryString("field")
If oEmp(fName) <> "" Then
If fName = "Salary" Then
' Validate Salary
oEmp.CallMethod "ValidateSalary"
Else
' Validate (Numeric/Date/Time)
vType = Request.QueryString("type")
oEmp("ServerValidate").Value = fName & VM & vType
oEmp.CallMethod "Validate"
End IF
If Err.Number Then DisplayError
If oEmp("ServerStatus") = 1 Then focusObj = fName
End If
End Sub
Sub ClearForm()
' Clear form via Clear method
oEmp.CallMethod("Clear")
focusObj = "EmpId"
End Sub
Sub UpdateEmp()
' Update all property values in Emp object
oEmp("EmpId").Value = Request.Form("EmpId")
oEmp("LastName").Value = Request.Form("LastName")
oEmp("FirstName").Value = Request.Form("FirstName")
oEmp("Salary").Value = Request.Form("Salary")
oEmp("HireDate").Value = Request.Form("HireDate")
oEmp("Dept").Value = Request.Form("Dept")
oEmp("Interests").Value = oFld.SwapString(Request.Form("Interests"), vbCrLf,
VM)
End Sub
%>
112 RedPages
RBODemo
<SCRIPT language="JavaScript">
function SendToWebServer(action)
{
document.Form1.action = "EmpMaint.asp?action=" + action;
document.Form1.submit();
}
</SCRIPT>
<BODY BGCOLOR="#FFFFFF">
<% If oEmp("ServerStatus") = "1" Then
Response.Write("<BR>Error: " & oEmp("ServerMessage"))
End If
oEmp("ServerStatus").Value = 0
oEmp("ServerMessage").Value = ""
%>
<FORM NAME="Form1" METHOD=POST>
<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=0 WIDTH=450 STYLE="font-fam-
ily:Arial;font-size:12">
<TR><TD COLSPAN=3 ALIGN="CENTER"><H3 STYLE="back-
ground:#D29B9E;color:#633132;font-family:Arial">Employee Mainte-
nance</H3></TD></TR>
<TR>
<TD vAlign=center NOWRAP><BR>Employee ID</TD>
<TD vAlign=top>
<INPUT name="EmpId" size=5 value="<%=oEmp("EmpId")%>" onchange=SendToWeb-
Server("ReadData")>
<A HREF="EmpLookup.asp"><IMG height=30 src="images/btn_lookup.jpg" bor-
der=0></A>
</TD>
<TD vAlign=top width="59%" ROWSPAN=4 ALIGN="RIGHT">
<% ImageFile = oEmp("ImageFile")
If ImageFile = "" Then ImageFile = "onepixel.gif"
%>
<IMG height=121 src="images/<%=ImageFile%>" width=102>
</TD>
</TR>
<TR>
<TD vAlign=center>First Name</TD>
<TD vAlign=top>
<INPUT name="FirstName" size=25 value="<%=oEmp("FirstName")%>"></TD>
</TR>
<TR>
<TD vAlign=center>Last Name</TD>
RedPages 113
Chapter 4 - RBODemo
114 RedPages
RBODemo
<%
' Destroy objects (on Web Server)
If isObject(oEmp) Then
oEmp.Close
Set oEmp = nothing
End If
If isObject(oCodes) Then
oCodes.Close
Set oCodes = nothing
End If
If isObject(oDescs) Then
oDescs.Close
Set oDescs = nothing
End If
If isObject(oFld) Then
Set oFld = nothing
End If
%>
</FORM>
</BODY>
</HTML>
EmpLookup.asp
Program Example
RedPages 115
Chapter 4 - RBODemo
<HEAD>
<TITLE>RedPages</TITLE>
</HEAD>
<%
On Error Resume Next
page = Request.QueryString("page")
If IsEmpty(page) then
page = 1
Else
page = Cint(page)
End If
If firstTime Then
' Do selection
Set rs = oLookup.CallMethod("Select")
If Err.Number Then DisplayError
maxRows = oLookup("MaxRows")
Else
' Selection already done and have recordset
oLookup("page_no").Value = page
Set rs = oLookup.CallMethod("PageDisp")
If Err.Number Then DisplayError
' Set the recordset page size to number of items specified in RBO
pageSize = oLookup("items_per_page")
rs.PageSize = pageSize
pageCount = Int(maxRows/pageSize)
If maxRows Mod pageSize then pageCount = pageCount + 1
%>
<!--#include file="CommonSubs.inc"-->
<SCRIPT language="JavaScript">
function SendToWebServer(page)
{
116 RedPages
RBODemo
<BODY BGCOLOR="#FFFFFF">
<FORM NAME="Form1" METHOD=POST>
<CENTER><H3 STYLE="background:#D29B9E;color:#633132;font-family:Arial">Employee
Lookup</H3></CENTER>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=4 WIDTH=590 STYLE="font-fam-
ily:Arial;font-size:12">
<TR><TD VALIGN="TOP" COLSPAN=3><B>Click on an Employee ID to select it.</B></TD>
<TD ALIGN="RIGHT"><B>Page <%=page%> of <%=pageCount%></B></TD>
</TR>
<TR><TD WIDTH="10%" VALIGN="TOP" BGCOLOR="#000000">
<FONT FACE="Arial" SIZE=2 COLOR="#ffffff"><P ALIGN="LEFT">Emp ID</FONT></TD>
<TD WIDTH="30%" VALIGN="TOP" BGCOLOR="#000000">
<FONT FACE="Arial" SIZE=2 COLOR="#ffffff"><P ALIGN="LEFT">First Name</FONT></TD>
<TD WIDTH="30%" VALIGN="TOP" BGCOLOR="#000000">
<FONT FACE="Arial" SIZE=2 COLOR="#ffffff"><P ALIGN="LEFT">Last Name</FONT></TD>
<TD WIDTH="30%" VALIGN="TOP" BGCOLOR="#000000">
<FONT FACE="Arial" SIZE=2 COLOR="#ffffff"><P ALIGN="RIGHT">Photo</FONT></TD>
</TR>
<%
' Now script for each employee row
For i = 1 to rs.PageSize
if rs.EOF then Exit For
%>
<TR>
<TD WIDTH="25%" VALIGN="TOP">
<A HREF="EmpMaint.asp?action=ReadData&EmpId=<%=rs.Fields("EMP.ID")%>"> <%=
rs.Fields("EMP.ID")%> </A>
</TD>
<TD WIDTH="25%" VALIGN="TOP"><%=rs.Fields("FIRST.NAME")%> </TD>
<TD WIDTH="25%" VALIGN="TOP"> <%=rs.Fields("LAST.NAME")%> </TD>
<TD WIDTH="25%" VALIGN="TOP" ALIGN="RIGHT">
<IMG SRC=<% ="images/" & rs.Fields("IMAGE")%> WIDTH=80 HEIGHT=98>
</TD>
</TR>
<%
If i < rs.PageSize Then rs.MoveNext
Next%>
RedPages 117
Chapter 4 - RBODemo
<BR>
<% If pageCount > 1 Then %>
<FONT FACE="Arial" SIZE=2>Goto:
<% If page > 1 Then %>
<A HREF="JavaScript:SendToWebServer('<%=page-1%>')">Prev</A>
<% End If %>
<% For i = 1 to pageCount %>
<% If i <> page Then %>
<A HREF="JavaScript:SendToWebServer('<%=i%>')"> <%=i%> </A>
<% End If %>
<% Next %>
<% If page < pageCount Then %>
<A HREF="JavaScript:SendToWebServer('<%=page+1%>')">Next</A>
<% End If %>
</FONT>
<% End If %>
<%
' Destroy object (on Web Server)
If isObject(oLookup) Then
oLookup.Close
Set oLookup = nothing
End If
%>
</FORM>
</BODY>
</HTML>
CommonSubs.inc
<%
118 RedPages
RBODemo
CommonSubs.inc
Program Example
' Session id
sessionId = Request.Cookies("RedBack")("SessionId")
If Err.Number Then
DisplayError
Else
OpenObj = True
If objSave = 2 Then
RedPages 119
Chapter 4 - RBODemo
Response.Cookies("RedBack")(objName) = objHandle.RBOHandle
End If
End If
Else
' Object already created - re-create object
Set objHandle = Server.CreateObject("RedBack.RedObject")
objHandle.Open2 stdAccount, prevObjHandle, stdUserid, stdPassword, ses-
sionId
If Err.Number Then DisplayError
End If
End Function
Sub DisplayError()
Response.Write("Error: " & Hex(Err.Number) & " " & Err.Description)
End Sub
%>
120 RedPages
Appendix A - RedPage
Configuration Issues
RedPages 121
Appendix A - RedPage Configuration Issues
rgw.ini
Configuration of RedPages is controlled via the file rgw.ini file which is located in the Web
Server's 'document root' directory. If a Web Server is not present on the machine where RedPages
is install then rgw.ini is placed in the Windows directory instead.
Note
An example rgw.ini is automatically generated by the install procedure. You may use this file as is
or edit it to suit your requirements.
uvtest/udttest are the account names (a unique key used throughout RGW), fred is the host name of
the RedBack Server Machine, and 8300/8301 are the ports used to connect to the Responder.
If the Web Server Machine and the RedBack Server Machine are the same machine, use 'localhost'
instead of 'fred' above.
You can use the raw ip address instead of the hostname if you prefer. For example, for the account
uvtest quoted in the above example, you could use:
uvtest 203.14.103.84:8300
instead of
uvtest fred:8300
You can further control RedPages behavior for rgw.dll only by setting the RGWLOADINI system
environment variable as follows:
0 Default. Load rgw.ini contents at dll attach and use that cache thereafter unless rgw.ini
changes - in which case reload rgw.ini for all subsequent requests.
1 Fastest. Load at dll attach and never check on rgw.ini thereafter. It will be necessary to
restart IIS or other application using RedPages to pick up changes to rgw.ini.
122 RedPages
rgw.ini
2 This gets the location of rgw.ini at dll attach but unconditionally reload rgw.ini for every
request but is not particularly useful.
3 Do not do anything at dll attach. This gets the location of rgw.ini for each request and
unconditionally reloads rgw.ini for every request.
RedPages 123
Appendix A - RedPage Configuration Issues
Logging
Logging in RedPages is controlled through a set of rgw.ini settings that determine what level of
logging is required.
Note
redpages.log is located in the web server’s logging directory (“%SystemRoot%\System32\Log-
Files” by default) or the system temp directory if the web server logging directory cannot be found.
Logging Levels
panic
Panic level entries are internal errors that are deemed serious and may not be recoverable. Often
the only course of action is to terminate RedPages.
124 RedPages
Logging
err
Error level entries are internal errors that are classes as bad but not quite panic material.
wrn
Warning level entries are things that aren't actually errors but weren't really expected.
inf
Informational level entries show the state of operation at various points in the code.
RedPages 125
Appendix A - RedPage Configuration Issues
init
Initialization/termination entries are Informational pieces specifically related to the Initializataion
and Termination of RedPages.
trace
Trace entries show the entry and exit position of each function as they are called. Turning this on
generates a large amount of data and is only really of use to engineering.
verb
Verbose entries are informational level entries but those that occur a lot more frequently than oth-
ers or are sligthly larger in size.
big
Big entries and informational level entries again but are those that are generally big.
126 RedPages
Appendix B - RedBack
Error Codes
RedPages 127
Appendix B - RedBack Error Codes
Error Codes
Values are 32 bit values of the following syntax:
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+---+-+-+-----------------------+-------------------------------+
|Sev|C|R| Facility | Code |
+---+-+-+-----------------------+-------------------------------+
where
Sev - (bits 30-31) is the severity code
00
- Success
01
- Informational
10
- Warning
11
- Error
C - (bit 29) is the Customer code flag
R - (bit 28) is a reserved bit
Facility - (bits 16-27) is the facility code
Code - (bits 0-15) is the facility's status code
128 RedPages
Error Codes
is usually a pretty clean one. Other reasons for this error include: A filename
that has been passed is greater than 1024 characters or less than 3 characters,
The backend replied with an HTML form rather than XML.
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid. The Error
description should show the amount of memory being requested.
This is an internal error generated when trying to add the Spider version
information to the data being sent to the backend.
If this happens it is likely the internal stack has been corrupted. The Web
Server should be restarted.
The RedBack responder returned an error. The Error description will con-
tain the actual error message generated by the responder. These errors include,
The responder was unable to allocate memory to hold the sent data, The account
information sent was either invalid or unable to be located in the request data.
An error was generated while trying to create a Win32 event to use for
named pipe operations. The error number returned in the Error description is the
actual Win32 error code generated.
An error was generated when trying to get the size of a file while doing a
document get or put. This is usually due to an incorrect filename or path being
specified or the Web Server not having the correct permissions to access the
file.
An error was generated when trying to open a file while doing a document
get or put. This is usually due to an incorrect filename or path being specified
or the Web Server not having the correct permissions to access the file.
RedPages 129
Appendix B - RedBack Error Codes
An error was generated trying to read from a file. The error description
specifies which file the error occurred on. Generally if the file can be opened
the read operations should succeed. Check that the file can be opened with other
programs such as notepad.
An error was generated trying to write to a file. Check that there is suf-
ficient disk space to write the data.
An error was generated trying to read data from the backend. The most
likely cause of this is that the socket connection to the backend has been lost.
This could be due to some network disconnection or the backend responder exiting
because of some error condition. Check the responder log files to see if and why
it may have exited.
An error was generated trying to write data to the backend. The most
likely cause of this is that the socket connection to the backend has been lost.
This could be due to some network disconnection or the backend responder exiting
because of some error condition. Check the responder log files to see if and why
it may have exited.
130 RedPages
Error Codes
An attempt to call a method on a RedObject was made but the object has not
been successfully opened. Before any operation can be performed on a RedObject it
must first be opened by calling the Open method.
RedPages 131
Appendix B - RedBack Error Codes
132 RedPages
Error Codes
An Error was encountered while trying to get the specified field from
internal ADORecordset Object used by RedSet. Check the Err.Number, Err.Descrip-
tion values and the RedPages.log logfile for more information and look in the.
An Error was encountered while trying to set the specified field value of
internal ADORecordset Object used by RedSet. Check the Err.Number, Err.Descrip-
tion values and the RedPages.log logfile for more information and look in the.
This error occurs when a request is made over a persistent connection that
has timed out and been closed. Persistent connections are established from the
backend and are set up with a timeout period. If the connection has been inactive
for more than the amount of time specified by the timeout the connection is
closed.
RedPages 133
Appendix B - RedBack Error Codes
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid.
This is an internal error generated when trying to add Name Value pairs to
the data being sent to the backend. If this happens it is likely the internal
stack has been corrupted.
An error was generated when trying to set a socket to use blocking mode.
The Error description contains the actual error number returned from the winsock
function call.
The maximum length for the PATH_INFO environment variable has been
exceeded. The PATH_INFO environment variable set up by the Web Server has a max-
134 RedPages
Error Codes
imum length of 8Kb within RGW. The PATH_INFO environment variable contains the
Web Server URL, account details and persistent connection information.
The account name specified in the URL could not be found in the rgw.ini
file. The only accounts available to RGW are those that have been defined in the
rgw.ini configuration file.
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid.
This error occurs when a request is made over a persistent connection that
has timed out and been closed. Persistent connections are established from the
backend and are set up with a timeout period. If the connection has been inactive
for more than the amount of time specified by the timeout the connection is
closed.
The combined length of all environment variable values has exceeded 16Kb
in length. This includes QUERY_STRING, PATH_INFO and the 18 other environment
variables the Web Server provides.
RedPages 135
Appendix B - RedBack Error Codes
The combined length of all environment variable names has exceeded 8Kb in
length. This includes QUERY_STRING, PATH_INFO and the 18 other environment vari-
ables the Web Server provides.
An error was generated trying to write data back to the Web Server.
An error was generated when trying to set a socket to use blocking mode.
The Error description contains the actual error number returned from the winsock
function call.
An error was generated trying to set signal handler for the Unix signals
(Unix only)
136 RedPages
Error Codes
The maximum length for the PATH_INFO environment variable has been
exceeded. The PATH_INFO environment variable set up by the Web Server has a max-
imum length of 8Kb within RGW. The PATH_INFO environment variable contains the
Web Server URL, account details and persistent connection information.
The account name specified in the URL could not be found in the rgw.ini
file. The only accounts available to RGW are those that have been defined in the
rgw.ini configuration file.
An error was generated while trying to update the host name and address in
the rgw.ini file.
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid.
The combined length of all environment variable values has exceeded 16Kb
in length. This includes QUERY_STRING, PATH_INFO and the 18 other environment
variables the Web Server provides.
RedPages 137
Appendix B - RedBack Error Codes
The combined length of all environment variable names has exceeded 8Kb in
length. This includes QUERY_STRING, PATH_INFO and the 18 other environment vari-
ables the Web Server provides.
An error was generated while trying to read data from the Web Server
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid.
The account name specified in the URL could not be found in the rgw.ini
file. The only accounts available to RGW are those that have been defined in the
rgw.ini configuration file.
A memory allocation has failed. This can either be because the system has
run out of virtual memory or the amount of memory requested is invalid.
The combined length of all environment variable values has exceeded 16Kb
in length. This includes QUERY_STRING, PATH_INFO and the 18 other environment
variables the Web Server provides.
138 RedPages
Error Codes
The combined length of all environment variable names has exceeded 8Kb in
length. This includes QUERY_STRING, PATH_INFO and the 18 other environment vari-
ables the Web Server provides.
An error was generated while trying to read from an Apache client block.
This error occurs when a request is made over a persistent connection that
has timed out and been closed. Persistent connections are established from the
backend and are set up with a timeout period. If the connection has been inactive
for more than the amount of time specified by the timeout the connection is
closed.
RedPages 139
Appendix B - RedBack Error Codes
140 RedPages
Index
A E
Account err, 125
name, 77 Error
Active Server Pages, 21, 21 codes, 128
ADO, 19, 28, 30, 31 handling, 87
Errors collection, 32
F
B
FrontPage, 21
big, 126
H
C
HomeSite, 21
CommandText, 78 HTML, 21
Configuration, 122
conventions, 10
I
inf, 125
D init, 126
Demonstration programs, 91 IP address, 77
DLL
redpages, 20
RedPages 141
Index
J P
Java, 21 panic, 124
Property, RedField
count, 56
L length, 57
StringValue, 59
Limitations, 26
ValueMark, 60
Logging, 124
Property, RedObject
Logging levels, 124
Account, 30
ActiveConnection, 31
M Errors, 32
Password, 32
Method, RedField Property, 32
Del, 61 RBOClass, 33
Ins, 63 RBOHandle, 33, 33
Replace, 65 UserID, 34
SubValue, 68 Property, RedSet
SwapString, 67 AbsolutePosition, 43
Value, 70 BOF, 44
Method, RedObject EOF, 44
CallMethod, 36 Property, 46
Close, 37 RecordCount, 46
Open, 35
Open2, 35
Method, RedSet R
AddNew, 47
RBO
Close, 48
creating an instance of, 77
Delete, 48
what are they, 21
Move, 49
RBOdemo, 91
MoveFirst, 50
RBOs, 21
MoveLast, 50
RedBack Business Objects, 21
MoveNext, 50
RedBack Designer, 21
MovePrevious, 50
RedField, 79
Open, 50
object, 55
Methods
RedPages, 18
calling Redback methods, 78
architecture, 18
142 RedPages
Index
configuration, 122
RedSet
object, 43
rgw.ini, 122
T
trace, 126
V
verb, 126
Visual Interdev, 21
W
wrn, 125
RedPages 143
Index
144 RedPages
RedPages DRB-3007