473,396 Members | 1,834 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,396 software developers and data experts.

How to access another database in my application

i want to access values of another database in my vba application

how to use it

can anybody give me sample code....
Aug 17 '12 #1

✓ answered by TheSmileyCoder

Linked tables are a fine solution if your always connecting to the same database. However there might be cases where you need to access information from a file selected by the user. In such cases you can either use OpenDatabase from your VBA environment, and then open recordsets from that database.

If you simply need to lookup data or even edit data, you can also open a recordset directly against another database from within the query syntax.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM tbl_Example in 'C:\TestFolder\TestDatabase.mdb'
I believe that is the correct syntax but otherwise it should be a simple matter to look it up.

4 2035
twinnyfo
3,653 Expert Mod 2GB
The easiest way is to link the tables of the other database with your current database.
Aug 17 '12 #2
zmbd
5,501 Expert Mod 4TB
Prasad:
Twinny for is correct. You will need to link to the tables witin the other database in as much as you would to any backend database. You use the linked tables in the same way you any such set of datatables.


-z
Aug 17 '12 #3
ariful alam
185 100+
@joshi,

create linked table to other database file to access the tables of that database file.
Aug 17 '12 #4
TheSmileyCoder
2,322 Expert Mod 2GB
Linked tables are a fine solution if your always connecting to the same database. However there might be cases where you need to access information from a file selected by the user. In such cases you can either use OpenDatabase from your VBA environment, and then open recordsets from that database.

If you simply need to lookup data or even edit data, you can also open a recordset directly against another database from within the query syntax.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM tbl_Example in 'C:\TestFolder\TestDatabase.mdb'
I believe that is the correct syntax but otherwise it should be a simple matter to look it up.
Aug 17 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
7
by: Chris | last post by:
Here's the situation: I work at a scientific institution and I have a portable electronic device which is used to take measurements. The device produces a very small amount of numerical data,...
5
by: Bob Alston | last post by:
I am looking for any Microsoft Access based software that could be used for a United Way agency that provides basic needs assistance - food, clothing, financial (rent, utilities, Rx, gasoline,...
6
by: ronwer | last post by:
Hello, The title doesn't completely cover the question I have, but it's a bit more complicated problem we have. We are using a database, based on Acces, but developed by a third party...
2
by: Sue Bricker | last post by:
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software...
8
by: Luminal | last post by:
Greetings Recently I've developed a C# application using an Access database. For this I use the Data.OleDb namespace. Now I have customer telling me that he can't use the application. The...
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
7
by: Allison | last post by:
Hi -- we are a small manufacturing looking for a multi-user database to take customer orders (nothing too complicated, with 3 users total). We think we should be using Access, but are wondering...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
3
by: pooba53 | last post by:
I have a VB .NET 2003 application that communicates with an Access db. I am deploying the application using the Wizard that creates an install package and it IS properly grabbing the Access db and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.