Windows – needed for a remote ODBC connection via PARKWAY ConnectWare for Micro Focus Files

odbcwindows

Recently I got the task of building a PHP application, that connects to a remote ODBC driver. We got the ODBC driver and set up a test environment.

Since it's my first time working with ODBC drivers, I have no idea what to do, to be able to connect to the driver. I know the code and I was able to connect to the ODBC driver using PHP and a DSN on the local machine. But since I have to connect from a remote machine using a DSN-less connection, I figure it's not that easy anymore.

The ODBC driver is custom (PARKWAY ConnectWare for Micro Focus Files) and we didn't get a documentation for it (only the connection string parameter description, which was helpful, but not enough to solve our problem). Googling didn't help either, we didn't find anything.

Does anyone know what else do you need to be able to remotely connect to an ODBC driver? Logically it makes sense that only the driver is not enough, some kind of server perhaps…

I'd be grateful for any kind of push in the right direction 🙂


UPDATE:

the PARKWAY support answered me with the connection string and the basic information. My first instinct was right — to be able to connect to an ODBC driver on a remote machine, I need their server application. I already installed their server evaluation copy and will play with it a little today. The connection string they suggested was:

Driver=PARKWAY ConnectWare for Micro Focus Files;DBQ=D:\MyServerData;Layout=Version3;FileType=Micro Focus;Location=MyServer

I did manage to get a different error when trying to connect this time:

SQL error: Failed to fetch error message

But I suppose this is a code problem.

Best Answer

Thanks for all the helpful comments, finally I was able to figure it out :)

If anyone is struggling with a similar problem, here is how I did it:

First I contacted support. If you are stuck with an uncommon piece of software, contacting support is usually the first step you should take. They usually have the right answers.

An ODBC driver is what its name suggests, a driver and nothing more. For any kind of remote access you need some kind of server. Also, if you want to access a remote data source, you need the driver installed on your client machine (the machine your remote application will be running on).

So far so good. In my case I got the connection parameter description from their support but still couldn't figure out, how the connection string looked like. I tried everything, but nothing worked (I got strange errors, that were not very helpful, like "couldn't fetch error message").

Finally I found an answer in this post: dsn-to-connectionstring

Looks like DSN records are nothing more than name-value pairs. Connecting to the data source by using a DSN worked, but I couldn't use a DSN in my particular case. So I got the needed parameters by opening REGEDIT and, as suggested by the above post, opening up the System DSN location:

HKLM\Software\Wow6432Node\ODBC\ODBC.INI\

This is the location where 32-bit System DSN records are stored. If you need to find the 64-bit version, it is located here:

HKLM\Software\ODBC\ODBC.INI\

Sure enough, there was the system DSN I needed. If anyone is interested in why I still didn't know how the connection string looks like, although I had the connection string parameter description:

To be able to connect to a remote server I had to add a "Location" parameter to the connection string. I tried adding the URL and/or IP of the server machine and it didn't work. By looking at the Registry I found out, that I actually have to add the IP, port and Protocol to a configuration file, specific for this ODBC driver. For the "location" attribute inside the connection string I had to specify the name of the configuration I added.