X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B071AD1B557 for ; Mon, 3 Nov 2003 17:38:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05185-09 for ; Mon, 3 Nov 2003 13:37:58 -0400 (AST) Received: from ecintweb.eldocomp.com (smtp.eldocomp.com [205.159.99.8]) by svr1.postgresql.org (Postfix) with ESMTP id 88A28D1B523 for ; Mon, 3 Nov 2003 13:37:56 -0400 (AST) Received: by ecintweb.eldocomp.com with XWall v3.28 ; Mon, 3 Nov 2003 10:37:50 -0700 From: Andrew Ayers To: Philippe Lang Cc: Mark , "pgsql-odbc@postgresql.org" Subject: Re: ODBC DSN Connections Date: Mon, 3 Nov 2003 10:37:39 -0700 X-Assembled-By: XWall v3.28 Message-ID: <3FA69263.80701@eldocomp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/15 X-Sequence-Number: 3417 Philippe Lang wrote: > Hello, >=20 > I have made some tests with .REG files, and it looks like what I need. Af= ter installing the driver on each PC, you simply run the .REG file, with al= l the keys of your ODBC connection. It allows you to configure a different = username for each user, which is fine if you want to manage permissions ser= ver-side. >=20 > I guess this .REG file can be run from a domain login script. >=20 > Does anyone have a better solution for distributing DSN (and drivers?) on= a large network? The solution is to not use DSNs - instead, write your application to use=20 a DSN-less connection. This way, the application, when it runs, sets up=20 its own "temporary" DSN(s), and you don't have a slew of them all over=20 the place, easy for the user to get at and (possibly) screw up. Note=20 that this doesn't eliminate the need for installing the driver on each=20 machine. I am not sure what to do to get around this issue. The only time you should use a system DSN is if it is on a single=20 machine, and the DSN is likely to be used by many different applications=20 on that machine (like perhaps a web or application server of some sort).=20 That way, if the DB location changes, you update the one DSN that all=20 apps use, and they are all happy. If you had each app set up on one=20 machine using its own DSN-less connection, then you would likely need to=20 update each app to tell it where the new location was. Now, perhaps the DSNs being put onto each machine are used by multiple=20 apps on the machine. This can be a thorny issue. DSNs are tough to=20 maintain, and DSN-less connections are also tough to maintain across=20 multiple apps. I would probably make an app that is run at startup that has a DSN-less=20 connection to a simple database set up on a small system that will=20 likely never change. This database would hold information telling the=20 location and DSN name for a bunch of databases. The app reading the=20 database would be put on each of the PC's. Now, from here, one of two=20 things can occur. Either each app can query this one app, to get the DSN=20 name and location for the DSN-less connection, or at startup, the app=20 can run, read the small database, and *overwrite* old system DSN=20 entries. So that, the user always has the latest up-to-date system DSNs=20 set up (you manage the DSN database yourself, likely through a small web=20 application or something). If they change them, the next reboot resolves=20 any issues. I suppose a service could also be created that runs on=20 startup that auto-checks the DSNs against the DB periodically and=20 updates as well, as needed. I suppose a third option could be that each=20 application could use the single DSN to first read the small DB to know=20 how to set up the DSN-less connection itself, instead of creating the=20 system DSNs each time. As far as the drivers are concerned, I would say you need to do the same=20 as you currently do for installs of any other software on the systems.=20 Of course, this can be time consumming. I will tell you what I did for=20 an application I take "care" of: This application is a VB executable that is distributed across many=20 machines in the company I work for. For a long time, we were compiling=20 the app, rebuilding the install, and telling users to download and=20 install the application. After a while, this became a big deal, because=20 sometime people wouldn't install the new application, and continue to=20 use the old app version, or we had to send people to each machine to=20 update it. I ended up writing a little application that would act as an "update"=20 utility. Each user of the main application being distributed has to log=20 into the application. I set up on the database a flag that says "update=20 this user". When the flag is checked (handled by admins on the main=20 application), and the user nexts logs in, it checks the flag and if set,=20 only allows the user to update or log out - nothing else. They *cannot*=20 log back into the system until they update the application. When they=20 decide to update, the system runs the updater application, and kills the=20 main application. The updater application reads an update area on the=20 network, and copies over any updates (it is actually more complex than=20 this - the updater utility is actually a custom scripting engine that=20 allows it to do many different things to the user machine, under control=20 of an update script that administrators can change to suit the update=20 needed). After it is done, it "unflags" the user's update flag, and=20 restarts the main application to allow them to re-login. There is other logic that allows the updater (and the main application)=20 to update the updater (the issue involved is that you can't overwrite a=20 running EXE under Windows - so you have to "juggle" the applications,=20 shutting one down while running another that does the update - updating=20 the updater is a pain, but the functionality is there). So - we then=20 only had to make one last "manual" update to everybody's system - and=20 then we could do all future updates remotely. Since its inception, it=20 has worked as designed, and has virtually eliminated our need to=20 manually update users systems, at least for the application which it=20 services (and technically, it could probably be used for other updates,=20 such as external software and such, but we haven't had a need to explore=20 that path yet). Something like this could be what you need to implement, to distribute=20 the driver (and any other future updates) to users. If you write such a=20 system, try to anticipate *all* possible uses, and design the scripting=20 system to allow for this (for example, my updater allows for moving,=20 copying, and deleting of files on the client machines - there are other=20 commands in the scripting language for displaying message boxes,=20 yes/no/ok/cancel boxes, etc - as well as branching of the script so the=20 user can do certain things). I know when I first created the updater, I=20 didn't originally design it to update the updater - then I found I=20 needed to do this. However, because I had designed in a ton of stuff=20 into the updater on the first round, creative scripting for the updater=20 (and some extra coding in the application) allowed me to get around this=20 issue, and update the updater. Had I not designed a lot of extra=20 functionality into the system in the beginning, I likely would have had=20 a problem when it came time to update the updater. I hope this makes sense... Andrew Ayers Phoenix, Arizona -- CONFIDENTIALITY NOTICE -- This message is intended for the sole use of the individual and entity to w= hom it is addressed, and may contain information that is privileged, confid= ential and exempt from disclosure under applicable law. If you are not the = intended addressee, nor authorized to receive for the intended addressee, y= ou are hereby notified that you may not use, copy, disclose or distribute t= o anyone the message or any information contained in the message. If you ha= ve received this message in error, please immediately advise the sender by = reply email, and delete the message. Thank you.