Ask a Question related to ASP Database, Design and Development.
-
Laphan #1
Changing DBs in one connection
Hi All
I've done an ASP which connects to an SQL DB.
My problem is that I want to distribute this ASP page, but I can't do a
straight DSN=MyDSN to point to the DSN, because I need to play with the
Master DB first (to get a list of dbs) and then when this db choice is
posted I use the actual selected DB. At present, this means I have to
specify the whole DSN(less) string (eg, server name, username, password,
database) so that I can use master and then the db.
Is there a way of specifying a straight DSN, which I know that they will
have set up and then change the DB as I do my SQL-ie bit?
Many thanks
Rgds
Laphan
Laphan Guest
-
Net connection without Internet connection whoas
Hi does flash media server 2 require a connection to the internet i'm using the evaluation version on a computer which is not connected to the... -
Changing text without changing frames.
I have a small flash movie that is basically a color chooser. Rather than changing the color of an item by putting the color in a frame I change... -
CryptographicException - Bad Data when changing from SSL to no secure connection
Hi, in a asp-vb.net web application, i have a login page. when i use the login page with http:// url, everything is fine, authentication works.... -
One NFS connection fine, one NFS connection slow
Ok, this is all a bit odd. I will draw an ascii picture and hope it survives in Google: sun server | .------mandrake... -
Have internet connection but not workgroup connection.
In article <Xns93B9BBF24CB33adfslur0mdoaur03jadl@207.46.248.16>, Frank Dreyfus <fdreyfus@nyw.com> wrote: I've written a web site that should help... -
Aaron Bertrand - MVP #2
Re: Changing DBs in one connection
Why can't you run a query like this:
set rs = conn.execute("SELECT * FROM database1.dbo.table_name")
....
set rs = conn.execute("SELECT * FROM database2.dbo.table_name")
Your connection string does not need to be restricted to a specific DB. You
can use three-part naming to access any database, as long as the user has
access to the specified database.
BTW, for a list of DBs, you can call this from any database, without having
to connect directly to master:
SELECT CATALOG_NAME FROM INFORMATION_SCHEMA.SCHEMATA
Also, don't use a DSN!!!! [url]http://www.aspfaq.com/2126[/url]
"Laphan" <news@FrozenMoles.co.uk> wrote in message
news:bjiknk$7pm$8@hercules.btinternet.com...> Hi All
>
> I've done an ASP which connects to an SQL DB.
>
> My problem is that I want to distribute this ASP page, but I can't do a
> straight DSN=MyDSN to point to the DSN, because I need to play with the
> Master DB first (to get a list of dbs) and then when this db choice is
> posted I use the actual selected DB. At present, this means I have to
> specify the whole DSN(less) string (eg, server name, username, password,
> database) so that I can use master and then the db.
>
> Is there a way of specifying a straight DSN, which I know that they will
> have set up and then change the DB as I do my SQL-ie bit?
>
> Many thanks
>
> Rgds
>
> Laphan
>
>
Aaron Bertrand - MVP Guest
-
Manohar Kamath [MVP] #3
Re: Changing DBs in one connection
You can issue a USE statement within a connection context and then start
issuing your queries:
USE myDB1;
-- This goes against myTable in myDB1
SELECT * FROM myTable;
USE myDB2;
-- This goes against myTable in myDB2
SELECT * FROM myTable;
--
Manohar Kamath
Editor, .netBooks
[url]www.dotnetbooks.com[/url]
"Laphan" <news@FrozenMoles.co.uk> wrote in message
news:bjiknk$7pm$8@hercules.btinternet.com...> Hi All
>
> I've done an ASP which connects to an SQL DB.
>
> My problem is that I want to distribute this ASP page, but I can't do a
> straight DSN=MyDSN to point to the DSN, because I need to play with the
> Master DB first (to get a list of dbs) and then when this db choice is
> posted I use the actual selected DB. At present, this means I have to
> specify the whole DSN(less) string (eg, server name, username, password,
> database) so that I can use master and then the db.
>
> Is there a way of specifying a straight DSN, which I know that they will
> have set up and then change the DB as I do my SQL-ie bit?
>
> Many thanks
>
> Rgds
>
> Laphan
>
>
Manohar Kamath [MVP] Guest



Reply With Quote

