Any help would be appreciated.
Thanks,
Tommy Ladner
In the sample, there is one table named stock (I do not have sample 10, I am
going off sample 12). Since the Access ODBC driver points to the file,
anywhere in the program it references "STOCK", it is referring to the table
"STOCK" in the file STOCK.MDB and not just the file. So all you have to do
is put the filename that you want to access in where "STOCK" is in the SQL
statements and then adjust the field names to correspond to your field
names.
I am sorry that I do not have any code but I can help with specifics if you
cannot get this working.
--
Brad Prothero
Clarica Life Insurance
Fargo, ND
TCLadner <tcla...@aol.com> wrote in message
news:20001229105652...@ng-cu1.aol.com...
There are 2 ways you can access Databases using Fujitsu.
You can use the DataBase control provided with PowerCOBOL or you can use
embedded SQL from within COBOL97 or PowerCOBOL.
If you are using the DataBase control you must specify the data source and
it behaves very much like Visual Basic using MicroSoft's DAO (Data Access
Objects).
If you are using embedded SQL you can specify the table you want through
SQL.
(This is not Fujitsu dependant, it works across any RDB platform)
After successfully connecting to the database (you can do this with an SQL
CONNECT or you can use the RTE (Run Time Environment) file (Cobol85.cbr)),
you should specify the required table using SQL. There are 2 ways to do
this:
1. Qualify the column name by prefixing the table name to it. Like this:
table1.column1
2. Specify the table in the SQL "FROM" statement. (I would recommend this as
it makes less "clutter" when your SQL gets complex).
SELECT column1, column2, column3
INTO :column1, :column2, :column3
FROM table1
WHERE column2 = "hello"
(Note you must use an SQL DECLARE for the host variables before you can
reference them in an INTO. They are prefixed with a colon, when referenced
within SQL, but just as a normal COBOL dataname outside the SQL (no colon).
So, after the above statement you would find the contents of column1 on
table1, for the row where column2 = "hello", in the dataname "column1".
(Similarly for column2 and column3) You can then reference "column1" as a
COBOL dataname and manipulate it.
You can "join" tables by assigning a correlation variable to replace the
table name. It's like a "shorthand" qualifier.
FROM table1 x, table2 y
"x" and "y" can now be used to reference the appropriate tables....
WHERE x.col1 = y.col1
would match the "col1" fields on table1 and table2.
You can see from the above there are a number of options for specifying
tables.
If you need more, mail me privately and I'll send a complete tutorial.
Pete.
TCLadner wrote in message <20001229105652...@ng-cu1.aol.com>...
The tutorial has been despatched, along with the response you asked for.
If you find it useful, please post here. (There are some in this forum who
don't believe I actually try to help people...<G>)
Pete.
TCLadner wrote in message <20001229105652...@ng-cu1.aol.com>...
>I'm trying to make the switch from Micro Focus DOS COBOL to Fujitsu COBOL
4.0.
>I ran the sample10 ODBC program and it seems to work okay. The sample
reads an
>ODBC data source that points to an ACCESS97 database that contains one
table.
<snipped>