Running the ADO sample

In order to make the ADO.SBR routine available to A-Shell, the following line should be added to the A-Shell initialisation file, MIAME.INI:

ALIAS=ADO,JBXcall:ADO

This will define the ADO.SBR routine to A-Shell.

The sample AlphaBASIC application, ADOTST, is included in the XCALL sample Visual Basic project (installed with the A-Shell ActiveX SDK) in the form of two related documents. ADOTST.TXT should be copied into an A-Shell accessible directory and renamed to ADOTST.BAS, and ADO.TXT should be copied into the same directory and renamed to ADO.BSI. It should then be possible to compile ADOTST from within A-Shell.

Before running the ADOTST application, it is necessary to configure the connection string, used to connect to the database. This connection string is a standard OLEDB connection string, and determines which server and database the application is to use. The default code uses a SQLServer database ‘TEST’ on a server ‘MICHELOB’ with the user name ‘sa’, and password ‘password’, as shown in the code segment below.

! *** Create our connection ***
! (For this example, it is against a TEST database with one
!   PRODUCTS table)

    SERVER = "MICHELOB"        ! *** CONFIGURE ***
    DATABASE = "TEST"          ! *** CONFIGURE ***
    USER = "sa"                ! *** CONFIGURE ***
    PASSWORD = "password"           ! *** CONFIGURE ***
    CONNECT'STRING = "Provider=SQLOLEDB.1;" + &
                     "User ID=" + USER + ";" + &
                     "Password=" + PASSWORD + ";" + &
                     "Initial Catalog=" + DATABASE + ";" + &
                     "Data Source=" + SERVER

The appropriate lines will need to be modified.

It is possible to run the example against databases other than Microsoft SQLServer, by specifying a different OLEDB provider. For example to use an Oracle database with the Oracle OLEDB provider, the provider string “OraOLEDB.Oracle” would be specified in place of “SQLOLEDB.1”, together with the ‘User ID’, ‘Password’, and ‘Data Source’ values.

 

If you do not have a copy of SQLServer available, then the SQLServer 2000 Desktop Engine (also known as MSDE 2000) may be used with this test application, and is suitable for small database requirements. This is a freely redistributable cut-down version of SQLServer 2000. More information is available at: http://www.microsoft.com/sql/techinfo/development/2000/MSDE2000.asp