OK .. I've asked this question a couple of times and, so far, no one has had
an answer.  Well, I finaly figured out the answer with help from my DBA.
The main question has been "How do I connect to different databases using
the same DSN!!"

I don't know how usefull anyone else would find this, but it was of major
importance to us, so I'm going to throw it out there in case someone else
ever wants to know how.

Basicly, you use the "connectstring" parameter of cfquery.  It would look
something like this:

<cfquery name="qry_myReallyCoolQuery" datasource="#Client.userDSN#"
connectstring="uid=#Client.UserID#;pwd=#Client.Password#;dbf=#Client.myDBFil
e#;svr=#Client.myDBServer#;links=#Client.DBServerLink#"
cachedwithin="#createTimeSpan(0,0,0,0)#">

This connectstring is for a Sybase database/engine.

It breaks down like this:

<!--- Begin 1:  You don't have to include these in the connectstring if you
want to use them in <cfquery>, but for our needs, putting them in the
connectstring makes sense, since we store the whole connectstring in a
Client variable and the uid and pwd passed to the server determines access
permissions. --->
    uid = cfquery's username attribute
    pwd = cfquery's password attribute
<!--- End 1>
dbf = the name of the database file you wish to actually connect to as seen
by the computer that runs the database engine (ex:
E:\my_path\to_the\database_file\database.db)
svr = the name of the database engine that CF should look for to find the
dbf (optional if you have one db engine)
links = the protocol info CF might need to connect to the database (in our
case, 'NetBIOS')

I havn't tried this with any other database, so I don't know if the syntax
is the same, but hopefully you get the idea.

If you have any questions, email me and ask away :)

Todd

----- Original Message -----
From: "Todd Ashworth" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, June 29, 2001 10:45 AM
Subject: cffile, cfregistry, and clusters, oh my


> I need some suggestions on several different topics here.
>
> 1.  We have a web app that will be used by many, many people.  We would
like
> to host this app on a cluster of servers.  The catch is, we want everyone
to
> use the same copy of code for the app, but each person/company needs their
> own database.  If we get 1000 companies using this thing, I don't want to
> have to replicate 1000 different DSNs for the different databases accross
> all of the clustered servers.  What I would like to do is find a way to
> connect to the various databases without having to use a DSN.  We tried
> using OLEDB and specifying the database file, but we couldn't get that to
> work.  Maybe someone could explain to me how to get OLEDB to work with
> Sybase 7, or maybe tell me another way to do what I'm trying to do.
>
> 2.  We want people who want to use the app to be able to sign up for it on
> the web site and begin using it almost immediately, without any
intervention
> on our part.  Signing up for the app requires that the sign up program
> creates some folders and registry entries on each server in the cluster.
Is
> there an example, or tutorial where the best way to handle this is
> explained?
>
> Thanks
>
> Todd
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to