Change DB that Access query points to - sql

I'm trying to make a query in Access 97 point to a different database. I cannot find out how to change the db.
I've tried adding another odbc connection but it doesn't give me the option to choose it when running the query.
I've tried to create another query but it still has the old db tables and i cannot choose the new db tables.
Any suggestions would be much appreciated.
thanks,
Nighmares

Try viewing the SQL source of your query. Is the old database name there? Can you just replace it and save your change? Another option would be to point your existing ODBC connection to the new database.

when you add another ODBC database Access will give you the option to add tables from it. You'll need to add whichever tables you need or you won't be able to access them via design view.
You can always use the Connection object to dynamically connect to any DB.

Related

Microsoft SQL Server connection error with Visual Studio.net (Windows forms)

I've been trying for a while to connect the database to visualstudio.net and it just doesn't work.
First I made the database and made everything I needed there and when I tried connecting it in visual.net through datagridview (trying to get it displayed there) it only gives me access to the "System databases" in which I can't make a database.
After that I decided to make the tables under the "master" database to see if that worked and yeah I can select the database and everything but it says it's empty when I know it's not. It says it has no tables when I've checked multiple times and saw the tables I've created there.
I would appreciate some help to either be able to get for visual to accept a database I make (to be able to automatically detect it once I enter the server name) or to see how can I use the master one properly.
You can add a data source to your project and it will be able to connect to the user databases. Also, it is highly inadvisable to create any user objects in the master database.
master database is a system database and you should not create user objects in the system database. In the connection string, provide the user database name explicitly. If you dont provide the database name, it defaults to master database.
Refer to connection strings for Sql Server for providing the right connection string for SQL Server in .net.

how do i change the sql query on a crystal reports locally without access to a customer's database from my machine?

I need to change the sql query used to pull data from a customer's database on an already existing report but they dont have crystal reports installed on their sql server.
I have a copy of their data on my local machine and can make the change and test it with no problems, but when I upload the report back onto their sql server, it complains that it can't find the database (unsuprisingly, as I've had to change the connection in the report to use the copy of their data on my machine!)
What I need to know is how I'm able to edit the sql query used on the report on my machine and have it retain the database connection that's used on the report somehow?
The change i need to make on the report is a bit more complicated than changing links in the database expert in crystal, its a change to the sql query used to pull the data from the database.
thanks, any help is appreciated, i'm fairly new to crystal reports so apologies if this is a simple fix.
You can change the SQL offline if you are using a command. If you are using database expert, you need to connect to the database, which you are already doing. To update database connection on the client computer you can use a tool like this one http://r-tag.com/Pages/CRDataSource.aspx.

Pentaho CDE how use my database

I'm trying to create a Penaho Dashboard using CDE and I have problems accessing my Data.
I have found tutorials but they always use SampleData or Steel Wheels. I have managed to do that myself, but I need to access my own database.
I was able to connect with my oracle database from the Data Source manager and created my own Data Source. But now I don't know how to access those tables from CDE. If I chose "sql datasource" I see the SampleData datasource and can do queries on it, but not the one I created with my database.
So, once I create a connection with my orcale database, how do I access my tables from CDE?
Thanks
There are two options:
SQL over JDBC: you define the db host, port, name, username and password;
SQL over JNDI: it'll use a registered JNDI from the Pentaho platform.
The JNDI field is an auto-complete field and fills in the various available options. However, if your newly created connection doesn't show up there, don't worry. Just type it in, it'll work.
you have to setup your data-source..
Click on datasources-panel on right corner
Click on sql Queries from the list you have seen on left side.
then click on sql over sqljndi
now here in properties in jndi set your database connection you want to access.
you can-not see the out-put of particular query in CDE for that open the same file in CDA for checking particular query's result(which you can find under files section).

can't see tables in SQuirrel

I am using a HSQL driver to connect to my database. I am able to connect without any errors but I can't see any of my tables in the table tree under public. I am able to create new tables which do appear, but I can't see the already created ones. Also when I check the .script file I can't see the new tables. Something strange is going on but I can’t work out what.
Anyone able to help.
I've worked it out now. It was the format of the connect string for HSQL.
I needed to add :file: in the string like this... jdbc:hsqldb:file:
Also I was using .script at the end of the file name, like this jdbc:hsqldb:.script
This was creating temp files in the format .script.lck .script.log etc.
Dropping the .script at the end of the file name opened up the database and allowed me to see the tables. Now my problem is I can't get any updates to commit. Updates happen with no errors in the console. But when I close the file and check the .script file the data is the same. Permissions I guess.
Only posting this answer to help others that might get stuck at the same point.
Try here:
How can I list all tables in a database with Squirrel SQL?
Where most of us fails is to choose the right schema in the Catalog dropdown. (Just above the Objects tab). But there are other ideas if you follow the related question.

Can't access ODBC data source from Matlab's Database Toolbox

I use Matlab's Database Toolbox to extract data from a SQL Server database. Today the database admin created a new table, but I can't seem to access it. The new table contains a schema called dbo, and when I try to access it using Matlab's querybuilder tool, the tool gives the following error:
Unable to get table information from data source
I can access other tables in the database without a problem. Any idea what is causing this problem? I don't have enough familiarity with SQL to diagnose it.
Have the admin check that this new table has the same permissions and attributes of a table that you know is working. If the permissions are messed up, you would not be able to retrieve metadata about it.