For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2006 > Fujitsu ADO Data access guidance needed









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Fujitsu ADO Data access guidance needed
Robin Lee

2006-08-25, 6:55 pm

Could someone please provide some sample code or point me to a good
tutorial or reference material regarding the use of ADO to access
Microsoft SQL server, under Fujitsu PowerCobol v6.1

Some years ago I recall that I used embedded and SQL and ODBC with Fuji
version 5 but that's all rather fuzzy to me now. I think I saw a post
here stating that ADO is better.

I've used the samples provided with the v6.1 compiler, utilizing the
AdoDataAccess control to successfully connect to and browse a known
dataset, but the examples are very elementary.

I'm hoping to come up with some simple code to perform typical COBOL
data access along the lines of traditional START KEY/READ NEXT (UNTIL).

I'm sure someone's been here before. Thank you to anyone who can help.
Frederico Fonseca

2006-08-25, 6:55 pm

On Fri, 25 Aug 2006 10:23:31 -0400, Robin Lee <robinlee@news.com>
wrote:

>Could someone please provide some sample code or point me to a good
>tutorial or reference material regarding the use of ADO to access
>Microsoft SQL server, under Fujitsu PowerCobol v6.1
>
>Some years ago I recall that I used embedded and SQL and ODBC with Fuji
>version 5 but that's all rather fuzzy to me now. I think I saw a post
>here stating that ADO is better.
>
>I've used the samples provided with the v6.1 compiler, utilizing the
>AdoDataAccess control to successfully connect to and browse a known
>dataset, but the examples are very elementary.
>
>I'm hoping to come up with some simple code to perform typical COBOL
>data access along the lines of traditional START KEY/READ NEXT (UNTIL).
>
>I'm sure someone's been here before. Thank you to anyone who can help.

First of all DO NOT use their control. it will give you more headaches
than you are expecting.

Second search google for that subject, as I have post a few things
about it already.

www.tek-tips.com also has a few samples of mine on the FAQ's of COBOL.

As for full samples, you really need to refer to how other (in VB) use
recordsets, as that is how you will also need to do. Just adapt the
methods to the way COBOL constructs them.

Also stay away from bound controls if you can.


Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
Pete Dashwood

2006-08-26, 3:55 am


"Robin Lee" <robinlee@news.com> wrote in message
news:Gu6dnTztv7qQlXLZnZ2dnUVZ_t-dnZ2d@giganews.com...
> Could someone please provide some sample code or point me to a good
> tutorial or reference material regarding the use of ADO to access
> Microsoft SQL server, under Fujitsu PowerCobol v6.1
>
> Some years ago I recall that I used embedded and SQL and ODBC with Fuji
> version 5 but that's all rather fuzzy to me now. I think I saw a post
> here stating that ADO is better.
>
> I've used the samples provided with the v6.1 compiler, utilizing the
> AdoDataAccess control to successfully connect to and browse a known
> dataset, but the examples are very elementary.


Then you will know it is quite OK to use it. (I disagree with Frederico on
this; I've used it a number of times and had no problems with it.) However,
for more detailed control, I find embedded SQL via ODBC is still the way to
go... Having said that, there is nothing to stop you creating an ADO object
through the COM interface and then using ADO commands to access whatever you
want. The Fujitsu provided control does this, but shields you from it.

>
> I'm hoping to come up with some simple code to perform typical COBOL data
> access along the lines of traditional START KEY/READ NEXT (UNTIL).


There seems to be some confusion here... These are COBOL file system
operations that really have nothing to do with Relational Databases. You
stated you want access to a SQL Server DB. You can certainly "mimic" these
operations against a RDB using a cursor, or a result set if you use access
via COM, but it is probably best not to think in these terms as it is tying
you to COBOL rather than to your data access needs.

>
> I'm sure someone's been here before. Thank you to anyone who can help.


Without more idea as to what you are trying to do, it is difficult to be
specific.

If you don't find what you want, mail me privately.

Pete.


Robin Lee

2006-08-27, 6:55 pm

Pete Dashwood wrote:
> "Robin Lee" <robinlee@news.com> wrote in message
[color=darkred]
> Then you will know it is quite OK to use it. (I disagree with Frederico on
> this; I've used it a number of times and had no problems with it.)


Thank you for that reassurance. I am after all still fairly new with
ADO, having only some exposure to it in VB.

> I find embedded SQL via ODBC is still the way to go...


I had pretty much assumed I'd be sticking with embedded SQL after seeing
some of Frederico's code. (Thanks Frederico for your response but I need
to keep this as simple as possible).

> Having said that, there is nothing to stop you creating an ADO object
> through the COM interface and then using ADO commands to access whatever you
> want. The Fujitsu provided control does this, but shields you from it.
>

I had seen this referenced in the Fuji docs and intend to explore it.

>
> There seems to be some confusion here... These are COBOL file system
> operations that really have nothing to do with Relational Databases. You
> stated you want access to a SQL Server DB. You can certainly "mimic" these
> operations against a RDB using a cursor, or a result set if you use access
> via COM, but it is probably best not to think in these terms as it is tying
> you to COBOL rather than to your data access needs.
>

I realize that RDB's do not store (nor access) data in the sequential
manner which we may be accustomed to in traditional ISAM databases.
Most of what I need to do is to extract records of a certain value or
within a certain range. In ISAM that would be START KEY NOT LESS THAN
and PERFORM UNTIL (greater than), and in SQL SELECT - FROM - WHERE - IN
.... something along those lines. From there I will likely build an ISAM
workfile, so sequence of the RDB data is not important. And the volume
of data is not tremendous so ODBC/SQL will likely be adequate.

> Without more idea as to what you are trying to do, it is difficult

to be
> specific. If you don't find what you want, mail me privately.
> Pete.
>

Thank you Pete. I will do some experimentation and contact you only if
necessary. And thank you both for your replies to my inquiry.

Richard

2006-08-27, 6:55 pm


Robin Lee wrote:

> I realize that RDB's do not store (nor access) data in the sequential
> manner which we may be accustomed to in traditional ISAM databases.
> Most of what I need to do is to extract records of a certain value or
> within a certain range. In ISAM that would be START KEY NOT LESS THAN
> and PERFORM UNTIL (greater than), and in SQL SELECT - FROM - WHERE - IN
> ... something along those lines. From there I will likely build an ISAM
> workfile, so sequence of the RDB data is not important. And the volume
> of data is not tremendous so ODBC/SQL will likely be adequate.


There is an ORDER BY clause if you need a particular sequencing.

James J. Gavan

2006-08-28, 6:55 pm

Robin Lee wrote:
> Could someone please provide some sample code or point me to a good
> tutorial or reference material regarding the use of ADO to access
> Microsoft SQL server, under Fujitsu PowerCobol v6.1
>
> Some years ago I recall that I used embedded and SQL and ODBC with Fuji
> version 5 but that's all rather fuzzy to me now. I think I saw a post
> here stating that ADO is better.
>
> I've used the samples provided with the v6.1 compiler, utilizing the
> AdoDataAccess control to successfully connect to and browse a known
> dataset, but the examples are very elementary.
>
> I'm hoping to come up with some simple code to perform typical COBOL
> data access along the lines of traditional START KEY/READ NEXT (UNTIL).
>
> I'm sure someone's been here before. Thank you to anyone who can help.


Follow-up on Pete's suggestion to contact him privately with any problems.

As regards examples, using Google with the search key "SQL-EXAMPLES", I
got 37.7K hits !

Jimmy
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com