Operating System - OpenVMS
1753482 Members
4142 Online
108794 Solutions
New Discussion юеВ

Re: Accessing SQLServer from VMS

 
Shael Richmond
Frequent Advisor

Accessing SQLServer from VMS

Does anybody access a SQLServer database from VMS and if so how?

We also have Oracle on VMS and I believe we can get a gateway from Oracle. But I didn't know if there were any other options available.
11 REPLIES 11
Ian Miller.
Honored Contributor

Re: Accessing SQLServer from VMS

parhaps you could use ODBC client on VMS - they may be one from Attunity Connec.
Or could use jdbc from java?
____________________
Purely Personal Opinion
Craig A Berry
Honored Contributor

Re: Accessing SQLServer from VMS

There are a number of options, including Attunity or one of the other commercial ODBC vendors like EasySoft or OpenLink.

I have a preference for FreeTDS since I'm the one who ported it to VMS :-). See:

http://www.freetds.org

There is also a pure Java JDBC client:

http://jtds.sourceforge.net/

Providing more information about the specifics of "access a SQL Server database" would probably net you more concrete help about the relative advantages of the different solutions. I.e., are you just exporting data and don't need transactional control? Or do you need full programmatic access? If so, what language(s) are you using? Do you need to access Oracle, SQL Server, and RMS from within the same program? Do you need access from DCL?

Do you have the budget and authority to install a special driver on each of the target systems you want to access (something all the commercial solutions will require)?

The list could go on, but you get the idea.
Shael Richmond
Frequent Advisor

Re: Accessing SQLServer from VMS

>There are a number of options, including >Attunity or one of the other commercial >ODBC vendors like EasySoft or OpenLink.

I looked at Easysoft but like you said it has a server side piece.

>I have a preference for FreeTDS since I'm >the one who ported it to VMS :-). See:

>http://www.freetds.org

I'll take a look at it.


>Providing more information about the >specifics of "access a SQL Server database" >would probably net you more concrete help >about the relative advantages of the >different solutions. I.e., are you just >exporting data and don't need transactional >control? Or do you need full programmatic >access? If so, what language(s) are you >using? Do you need to access Oracle, SQL >Server, and RMS from within the same >program? Do you need access from DCL?

The application is written in Fortran.
It would only need to access SQLserver.
The application is an interface to 3rd party product(Proficy). All it would be doing is
calling a stored procedure. Everything would be read only.

>Do you have the budget and authority to >install a special driver on each of the >target systems you want to access
>(something all the commercial solutions >will require)?

I could get the authority(and budget) but I'd prefer to keep this as a client side application only.
Craig A Berry
Honored Contributor

Re: Accessing SQLServer from VMS

Ah, good. You have fairly simple case. If you use FreeTDS you'll need to decide whether to use the dblib API or ODBC. If the latter, you'll also need a driver manager, specifically unixODBC (http://www.unixodbc.org). I think dblib would be a lot quicker to get up and running. ODBC would have the advantage that you could later swap out the innards to a different ODBC driver and leave your top-level code unchanged.

In any case you'll likely be calling C routines from FORTRAN, so you'll need to sort out how you want to do that. You can null terminate your strings and pass by reference, or you can write a layer in C that accepts values by descriptor, copies them to C strings, and passes them to the database library. In your case the "layer" might be a single routine that handles all database interaction and returns a result. Or the layer could provide a jacket around each database call. Attunity provides something like the latter, I believe.

Martin P.J. Zinser
Honored Contributor

Re: Accessing SQLServer from VMS

Hi,

depending on what you already have, you might be able to access SQL server using a Sybase client. For reference see

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarsqlsg/html/msdn_sqlintgr.asp

If I had to do it, I'd go the freetds route, but if you already have Sybase by chance it can be worth a look.

Greetings, Martin
Craig A Berry
Honored Contributor

Re: Accessing SQLServer from VMS

Martin,

With a number of pretty severe restrictions, yes, you can use the old, now-defunct Sybase clients to access MS SQL Server. If you have SQL Server before 7.0, you'll probably be fine. If you have SQL Server 7.0, you need, IIRC, SP2 since 7.0 as originally shipped accidentally broke compatibility with older versions of the TDS protocol. If you're using MS SQL 2000 or later, you're out of luck because these versions *intentionally* broke compatibility with older versions of the TDS protocol.

Under the limited circumstances in which the combination works, I believe you are limited to text and varchar fields with a maximum length of 255 characters.
Shael Richmond
Frequent Advisor

Re: Accessing SQLServer from VMS

Craig,

I downloaded FreeTDS and ran the configure.com But when I run MMS I got
the following error:

%MMS-F-GWKNOPRN, There are no known sources for the current target [.INCLUDE]TDS
_SYSDEP_PUBLIC.H_IN


Also the documentation refers to using SQSH
to test with but I didn't see a VMS version.
Is there something else I can test with?
Craig A Berry
Honored Contributor

Re: Accessing SQLServer from VMS

When you untar the archive, be sure to use the -o or /ODS2 option with vmstar, assuming you are on an ODS-5 disk. Otherwise you'll get a few caret-escaped filenames that the build procedure won't find.

When you've got a successful build, edit pwd.in and freetds.conf in the top-level directory and run MMS CHECK to test. You'll also have a tsql.exe and freebcp.exe for interactive SQL and bulk copy operations, respectively. See [.doc]tsql.txt and [.doc]freebcp.txt for the documentation of these utilities.
Shael Richmond
Frequent Advisor

Re: Accessing SQLServer from VMS

Does it require ODS-5?
I did it a little different and maybe that
was the problem. I untared it on my PC
then zipped it up. Then I FTP'ed it to
VMS and created a directory.
MMS only gave that one error but didn't create and exe's.