Thread: How to get ODBC going?
I've studied the docs and searched the archives, and also the ODBC driver info on the web site, and sorry but I still can't tell how to get this done. This is what I want to do: I have PostgreSQL database on Linux and I want to access it from Windows 95, using MS Access (but possibly other tools in the future). First I thought I needed to install an ODBC driver on the Linux side to do this (and the docs seemed to agree). But I couldn't find any. Then I found the ODBC info on the Postgres web site, and it seems to say I need to install the PsqlODBC driver on the Windows side instead. So I did, but now I'm stuck. The instructions don't match what I'm seeing on my system. They say to go to the ODBC Manager in Control Panel, and "First, select your favorite datasource to configure. Then in the "PostgreSQL Driver Setup" dialog, select under "Options (Advanced)" either the Driver button or Datasource button. This will bring up another dialog box which contains options you can configure." Well, first, my desired data source in this case is Postgres, but there's no Postgres listed. Even if I choose another data source there's no "PostgreSQL Driver Setup" button. So this is why I'm stuck. I even reinstalled the PsqlODBC driver on Windows to make sure it's there. So the question is now what am I supposed to do? Thanks for any help -- Warren
Well, I had some of the same issues as you when I first began. Here's my setup and what I did: My Setup: PostgreSQL 6.5.2 running on a RedHat Linux 6.1 system. Microsoft Access running on Windows 95/98 systems. What I did: On the Linux system: - Install PostgreSQL on my RedHat system from rpms. - Run initdb to setup the data directories - Edit /etc/rc.d/init.d/postgresql file to add the -i option to the postmaster line. This allows connections via tcp/ip sockets (ODBC uses this). - Create the databases and tables On my Windoze 95 boxes: - Install the PsqlODBC which was developed my Insight Distributors and is now available from ftp://ftp.postgresql.org/pub/odbc/latest/postdrv.exe <ftp://ftp.postgresql.org/pub/odbc/latest/postdrv.exe> . Some documentation on the configuration of this driver is available at ftp://ftp.postgresql.org/pub/odbc/psqlodbc_home.html <ftp://ftp.postgresql.org/pub/odbc/psqlodbc_home.html> . - Configure the driver by going to Control Panel, 32Bit ODBC (or ODBC data sources) . Click on the System DSN tab. Click add, select PostgreSQL and click on Finish. At this point you don't really need to enter anything, just click on OK. If you want, you can enter some values that will then become the default values of the driver configuration for when you actually access this ODBC resource. What I do is leave all these options as they are at this point. Then when I select the table that I want to link to in MS Access I configure the options at that point. The configured options will then be saved with the MS Access application for that table. - Link the tables with MS Access. I design and create all my tables from the psql command line interface on the Linux server. However, I understand that there is a Windows based application called pgadmin that allows you to design and create database tables on the server from the Windows PC that you're running (see http://www.pgadmin.freeserve.co.uk/ ) for more info on that. Looks cool but I haven't had the gumption to install it and the support MS applications that seem to be needed. I spent a lot of time with trial and error on this but I finally have it working quite well. I have 4 applications running under MS Access that have several tables each on the Linux server. I also have the database linked to my web site so that customers can look at database info by connecting via the web. Works well. Pat Patrick C. Wolf Test Manager Aerojet Socorro Plant -----Original Message----- From: Warren Odom [mailto:warren-odom@stenocall.com] Sent: Tuesday, July 18, 2000 7:48 AM To: pgsql-novice@hub.org Subject: [NOVICE] How to get ODBC going? I've studied the docs and searched the archives, and also the ODBC driver info on the web site, and sorry but I still can't tell how to get this done. This is what I want to do: I have PostgreSQL database on Linux and I want to access it from Windows 95, using MS Access (but possibly other tools in the future). First I thought I needed to install an ODBC driver on the Linux side to do this (and the docs seemed to agree). But I couldn't find any. Then I found the ODBC info on the Postgres web site, and it seems to say I need to install the PsqlODBC driver on the Windows side instead. So I did, but now I'm stuck. The instructions don't match what I'm seeing on my system. They say to go to the ODBC Manager in Control Panel, and "First, select your favorite datasource to configure. Then in the "PostgreSQL Driver Setup" dialog, select under "Options (Advanced)" either the Driver button or Datasource button. This will bring up another dialog box which contains options you can configure." Well, first, my desired data source in this case is Postgres, but there's no Postgres listed. Even if I choose another data source there's no "PostgreSQL Driver Setup" button. So this is why I'm stuck. I even reinstalled the PsqlODBC driver on Windows to make sure it's there. So the question is now what am I supposed to do? Thanks for any help -- Warren
"WOLF, PATRICK" wrote: > - Edit /etc/rc.d/init.d/postgresql file to add the -i option to the > postmaster line. This allows connections via tcp/ip sockets (ODBC uses > this). Hello, awhile back I had troubles getting ODBC connecting to the server, then I enabled the TCP/IP stuff and it worked perfectly. Hope this helps, David
Attachment
After some clues from the good people of the mailing list, plus some detective work, I have figured out where the roadblock was. In short, it looks like I was getting the 16-bit ODBC manager from the Windows 95 Control Panel. The 32-bit one is what I needed, but it was nowhere in evidence. I finally did a search for all files matching *odbc*.exe, and bingo! odbcadm.exe is the old one, and odbcad32.exe is the new one, which has the tabs for DSNs, etc. that I couldn't figure out what everyone was talking about. Further, the instructions on the web site are still lacking in some details, some of which you were able to fill in for me. I haven't had time to work on it any more since then, since I've been in a training class most of the week. (In fact, I had hoped to get an ODBC link to Postgres up & running for the class, but we ended up having to use MS SQL Server instead.) Maybe I can still find a role for Postgres somewhere ... Anyway, thanks to everyone that helped! (especially David Boerwinkle and Patrick Wolf). -- Warren -----Original Message----- From: davidb@vectormath.com [mailto:davidb@vectormath.com] Sent: Tuesday, July 18, 2000 12:48 PM To: Warren Odom Subject: Re: [NOVICE] How to get ODBC going? I am not familiar with this interface. I recommend you submit this to the General list. If you are not on the General list and do not wish to join it, I could submit it for you. Just out of curiosity, what do you get when you click on the setup button? David -----Original Message----- From: Warren Odom <warren-odom@stenocall.com> To: davidb@vectormath.com <davidb@vectormath.com> Date: Tuesday, July 18, 2000 12:15 PM Subject: RE: [NOVICE] How to get ODBC going? <<1. You've downloaded the PsqlODBC driver AND installed it on your Win95 machine?>> Yesterday. File name postdrv.exe from the Postgres web site. I have Windows 95 B, by the way. <<2. You've gone to Start/Settings/Control Panel and opened ODBC (or ODBC32, or whatever its called)?>> Yes. My control panel says ODBC, not ODBC32. <<3. You've selected the System DSN tab and clicked on the Add button?>> There is no System DSN tab. There are just buttons: Close, Help, Setup, Delete, Add, Drivers down the right (top to bottom); and Option at bottom left. It gives me a scrolling list that contains in part: dBASE files (Microsoft dBase driver (*.dbf) (32 bit)) Excel files (Microsoft Excel driver (*.xls) (32 bit)) MQIS(SQL Server (32 bit)) MS Access 97 Database (Microsoft Access Driver (*.mdb) (32 bit)) .... etc. Nary a Postgres among them. When I click on "Add..." or "Drivers..." there is no Postgres listed either. I guess this is a strong clue. But what to do about it? -- Warren
I did a grep -n snprintf * */* */*/* from the src directory, and I seen something odd in the output: backend/port:2:snprintf.c^@^@^@{^R^_^@^T^@ \ srandom.c^A^A^A^A{^R ^@^X^@^L\ strcasecmp.c^@^@^@^@P^R!^@^T^@ (all of that is one line) This is the only odd bit of output in the grep. Doing a directory edit with emacs doesn't show any odd characters in the file name, but srandom.c and strcasecmp.c are the 2 files following snprintf.c in the listing. There are a couple of strange looking symbollic links (go up 2 levels, then back down the same 2 levels they went up, and then down to a subdirectory of port). I'm guessing that this directory strangeness is what is causing the make to fail, but I have never seen anything like this before. Gord Matter Realisations http://www.materialisations.com/ Gordon Haverland, B.Sc. M.Eng. President 101 9504 182 St. NW Edmonton, AB, CA T5T 3A7 780/481-8019 ghaverla @ freenet.edmonton.ab.ca