Creating a Pass

download Creating a Pass

of 4

Transcript of Creating a Pass

  • 8/12/2019 Creating a Pass

    1/4

    Creating a Pass-through query from Access to an Oracle Database

    Creating a Pass-through query from Access to an

    Oracle Database.

    A pass-through query makes use of a stored procedure and ODBC (open database

    connectivity) to link an application, in this case Access, to data stored in another

    application, in this case Oracle.The pass-through query maintains all security reside

    on the parent (Oracle) application and can even add additional security based on the

    child (Access) application.In addition, extra security in the manner of the Citrix serv

    can be maintained.

    Overview of the Technology

    ODBC and its counterpart Oracle technology JDBC store a string of information, w

    define the computer and the path to the database on the computer. This issource str

    is obscured from the user by representing it with a DSN (Data Source Name) which

    friendly name of the parent administrators choosing ---George, for example.The

    child application then calls the name assigned by the parents administrator to confithe childs gateway using the friendly alias (George) to find and link to the parent

    application.Depending on how the parent administrator has defined the parent gatew

    or DSN, the resulting data can be pulled in a number of ways that can restrict or

    eliminate interaction with the parent data.

    Once the data source name has been defined, the child application can link to the pa

    database and pull data down by defining a connection string.This string Identifies

    ODBC-JDBC gateway, and can contain account and password information that allothe child application to link to a table or tables in the parent and selects, using SQL,

    data desired.Once in the child application the data can be used to create a local table

    generate additional queries, generate reports or generate web pages (especially in

    Access 2000)

    The pass-through query can link and pull specific data from the Oracle database in r

    time.Once in the Access environment these queries can be used just like tables but t

    only run once they or a dependant item (form, report sub query etc.)are called.

    Sett ing u p the Gateways

    To use the ODBC-JDBC gateway, the client computer must have the Data Source

    Names (DSN) set up to define the string that identifies the location of the Oracle

    database on the net.In the citrix environment where you are working on a remote

    computer, this must be done on the citrix server.The ODBC gateway for the child

    application must also be established on the remote computer. The Oracle DBA will

    configuring configure the JDBC using the oracle configuration tools to set up the

    le:///Y|/Data.Genesis/MyTechWritings/Pass-through/Creating%20a%20Pass.htm (1 of 4) [1/17/2006 1:35:16 PM]

  • 8/12/2019 Creating a Pass

    2/4

    Creating a Pass-through query from Access to an Oracle Database

    TNSNAMES.ora file and give a friendly name to the data source on the citrix

    server.Next, the Citrix or Oracle administrator establishes the ODBC using the ODB

    administrator tools on the NT citrix server. Once this is done any application using

    ODBC technology can access the Oracle data that is made accessible by this manne

    Accessing the Data with ACCESS

    1.

    Logon to the Citrix Metaframe.

    2. Within the citrix environment, start MSACCESS.

    3. Create a new database if desired.

    4. On the TABLE tab select new and Link Table, or on the FILE menu sele

    Get External Data then Link Table

    5. When the LINK screen opens, change the files of Type combo box to sel

    ODBC (bottom of selection list.)

    6. When the Select Data Source screen opens select the Machine Data Sourc

    tab and then select the friendly DSN that represents your data connection then

    clickthe OK button.

    7. Next, you will asked to logon to the Oracle environment.Enter your account

    name and your password and click OK.

    8. Oracle will then present you with a list of tables available to this

    environment.Select one or more tables that you wish to link to and then press OK

    9. Access will import a link to all tables selected.

    This is a permanent link to the ORACLE database and environment; consequently i

    places a heavy demand on the server to maintain the link.Also, depending whether t

    gateway was set up to serve up a read/write or snapshot of the data, it can leave the

    Oracle data open to (unwanted or accidental) change.For these reasons at least it is n

    advisable to create permanent links to data.This is where the pass-through query com

    in.

    le:///Y|/Data.Genesis/MyTechWritings/Pass-through/Creating%20a%20Pass.htm (2 of 4) [1/17/2006 1:35:16 PM]

  • 8/12/2019 Creating a Pass

    3/4

    Creating a Pass-through query from Access to an Oracle Database

    Bu i ld ing the PASS-Through query

    1. In ACCESS, open one of the table(s) you linked, above, in design mode yo

    will get a warning message that you are trying to open a Linked table and you ma

    not be able to save any changes do you wish to continue?Select Yes.

    2. From the properties icon on the toolbar select and highlight and copy the

    description property string.This string contains the ODBC connection information

    3. Once the connection information has been obtained you can close and delete

    linked table(s).

    4. Selecting the Query

    tab in Access you are

    now ready to build thePass-through query.

    5. Select the new

    query button, then select

    the design view

    mode.Close the Show

    Table screen, you dont

    need this to build a pass-

    through query.

    6. From the menu bar

    select QUERY and then SQL-Specific then Pass-through.A blank SQL page

    open.Again, select the properties icon on the tool bar as shown at right (the prope

    icon is the hand holding a properties sheet).

    7. Highlight the ODBC Connect Str property and paste the connection string y

    selected from your linked table.Move to the end of the string and delete any refer

    to tables ( you will be calling the table information from your SQL select stateme

    8. Close the properties and now you can write or paste an ORACLE specific SQ

    statement using PL-SQL.Remember however any modification or changes made

    the data has been pulled into the Access environment must be made in MS-SQL.T

    le:///Y|/Data.Genesis/MyTechWritings/Pass-through/Creating%20a%20Pass.htm (3 of 4) [1/17/2006 1:35:16 PM]

  • 8/12/2019 Creating a Pass

    4/4

    Creating a Pass-through query from Access to an Oracle Database

    means that you can use Debug() to choose the if, then, else convention or exists

    PL-SQL as long as you are addressing the Oracle Database, but once in Access y

    have to use iif() or In() to accomplish the same items.This can make for long and

    confusing SQL statements.

    9. Once your data is in ACCESS, you can build another query using your first q

    as a data source and using the Make-Table query option to temporarily store th

    records selected. This way you are pulling data down from the Oracle database bu

    not creating a persistent link Oracle or Citrix.

    10. Once you have the data you want in a table you can use Accesss tools to

    generate reports or other functions as needed.

    11. By using the ODBC Connection string and SQL statements coupled with VByou can create timed, stand-alone modules that draw down current data, generate

    reports, bundle formatted reports and send them off to a stored mailing list via em

    For more information contact Jennifer Wells at 381-2128 or (518)

    1471.

    le:///Y|/Data.Genesis/MyTechWritings/Pass-through/Creating%20a%20Pass.htm (4 of 4) [1/17/2006 1:35:16 PM]