473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Database as Variable for Param query

Hi,
Is it possible to pase the name of the database as a variable inside a
Parameter Query?

Parameter [MyDatabase] text;
Select * from [MyDatabase;

Thanks
LC

Nov 13 '05 #1
3 1249
Not sure why you'd ever need that, as Access can only have one database open
at a time. You can link to a large number of tables in a large number of
other databases, but their reference location will always be the single
database that is currently open.
-Ed

<ca******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
Is it possible to pase the name of the database as a variable inside a
Parameter Query?

Parameter [MyDatabase] text;
Select * from [MyDatabase;

Thanks
LC

Nov 13 '05 #2
On 27 Aug 2005 15:57:18 -0700, ca******@yahoo.com wrote:

I doubt it, but if you must, you could create a dynamic sql statement
with the IN clause:
select * from sometable in 'c:\test\test.mdb'

-Tom.

Hi,
Is it possible to pase the name of the database as a variable inside a
Parameter Query?

Parameter [MyDatabase] text;
Select * from [MyDatabase;

Thanks
LC


Nov 13 '05 #3
"Ed Robichaud" <ed*********@wdn.com> wrote in
news:Nz*******************@monger.newsread.com:
<ca******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
Is it possible to pase the name of the database as a variable
inside a Parameter Query?

Parameter [MyDatabase] text;
Select * from [MyDatabase;


Not sure why you'd ever need that, as Access can only have one
database open at a time. You can link to a large number of tables
in a large number of other databases, but their reference location
will always be the single database that is currently open.


No, it can't be done with a parameter.

But having multiple linked tables is not a terribly useful way to do
it, either, as you then have to change your recordsources on the fly
to point to one linked table or another. In that case, you might as
well have multiple saved queries. But again, you have to change
recordsources at runtime.

So, you're doing that, you might as well write code to write SQL
that includes the connection string to the appropriate back end.

And I don't think it's at all an uncommon thing. I've used it a lot.

Of course, I also don't use much in the way of parameter queries.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lawrence | last post by:
I posted before, but have now narrowed my problem down to this method. At the start of the method, I test to make sure that I have a resource, a pointer to data returned from a database. This test...
1
by: Jason | last post by:
this is my code and what i get... i'm accessing this through this url http://192.168.0.2/php/test2/test.php?user=me@test.ca&subject=test it grabs the correct stuff from the database, but...
4
by: Digital Fart | last post by:
howto make a connection to database available in my classes. What is the best practice when i want to write classes that need a connection to the database? Do i make a conn variable in my...
0
by: Daniel | last post by:
Hi, I'm trying to write an update command for a database. my tables are as follows EntryVersionTable entryId -> fileName, categoryName, entryName, version EntryTable entryId, languageName ->...
1
by: newhaven_lad | last post by:
Please could someone help, I have a Perl cgi script which works perfectly when run in a dos prompt, it connects to a database on my laptop and inserts a record. But when I use the internet browser...
15
by: bcochofel | last post by:
Hi, I want to use a variable to sort elements. That var his passed with query string (I'm using Perl CGI to generate XML). Here's a sample of my output:...
3
by: Skip | last post by:
OK, I'm a novice in JS but have lots of coding experience. I am trying to accomplish something that would seem somewhat simple - BUT IT'S NOT. I have a basic window that calls another window...
4
by: Zachary Turner | last post by:
Let's say I have a variable defined as follows: <xsl:variable name="test_variable_1" value="'test_value_A'"/> <xsl:variable name="test_variable_2" value="'test_value_B'"/> <xsl:variable...
2
by: Looch | last post by:
All, I'm trying to output but I can only get (brackets for clarity) when using the code below. How can I "break" into the query variable in the InsertName method to add the name parameter to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.