I need to be able to open a database from a macro on a form while already in one. Can anyone help?
6 1452
I need to be able to open a database from a macro on a form while already in one. Can anyone help?
The following Public Function will:- Open an External Access Database named Employees.mdb in the C:\Test Directory (C:\Test\Employees.mdb)
- Print all the Last Names in the tblEmployees Table to the Immediate Window
- If you so desire, a Macro within your Database can call this Function directly
- Public Function fOpenExternalDatabase()
-
Dim wrkMySpace As Workspace
-
Dim dbExternal As DAO.Database
-
Dim rstExternal As DAO.Recordset
-
- 'Create Microsoft Jet Workspace object
-
Set wrkMySpace = CreateWorkspace("", "admin", "", dbUseJet)
-
- 'Open Database object from external Microsoft Jet database
-
'for exclusive use.
-
Set dbExternal = wrkMySpace.OpenDatabase("C:\Test\Employees.mdb", True)
-
-
Set rstExternal = dbExternal.OpenRecordset("tblEmployees", dbOpenDynaset)
-
-
rstExternal.MoveFirst
-
-
Do While Not rstExternal.EOF
-
Debug.Print rstExternal![LastName]
-
rstExternal.MoveNext
-
Loop
-
-
rstExternal.Close
-
dbExternal.Close
-
wrkMySpace.Close
- End Function
NeoPa 32,556
Expert Mod 16PB
This'll confuse ADezii no end, but didn't we get robbed by the refs in UEFA this year?
Scanadalous!
Glad you got sorted here BTW. ADezii's our top man on macros and such.
This'll confuse ADezii no end, but didn't we get robbed by the refs in UEFA this year?
Scanadalous!
Glad you got sorted here BTW. ADezii's our top man on macros and such.
This'll confuse ADezii no end, but didn't we get robbed by the refs in UEFA this year?
Scanadalous!
You are 100% right because I am totally confused. What exactly does the above-mentioned quote mean, Neo?
NeoPa 32,556
Expert Mod 16PB
You are 100% right because I am totally confused. What exactly does the above-mentioned quote mean, Neo?
Spurs is the short name for a North London football team - Tottenham Hotspur. I'm guessing, with a name like SpursGirl, that the OP is also a fan.
We were (just) knocked out of the UEFA-Cup last week due to a number of consistently awful decisions by the refs in both legs (home and away). It would be no exaggeration to say that they were responsible for changing the score by about 5 goals to our detriment (As most of the decisions were penalties or free-kicks, it's impossible to be absolute). It's certainly true to say that we would have thrashed Sevilla with any sort of fair referee though. Even if only one of the legs was reffed fairly we would have got through without a problem.
Spurs is the short name for a North London football team - Tottenham Hotspur. I'm guessing, with a name like SpursGirl, that the OP is also a fan.
We were (just) knocked out of the UEFA-Cup last week due to a number of consistently awful decisions by the refs in both legs (home and away). It would be no exaggeration to say that they were responsible for changing the score by about 5 goals to our detriment (As most of the decisions were penalties or free-kicks, it's impossible to be absolute). It's certainly true to say that we would have thrashed Sevilla with any sort of fair referee though. Even if only one of the legs was reffed fairly we would have got through without a problem.
Now I'm only partially confused! NeoPa 32,556
Expert Mod 16PB Now I'm only partially confused!
Tell me which bit(s) are still confusing and I'll happily explain.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: I Are Confused |
last post by:
I am trying to open Database #2 while in Database #1 and delete a
table that is in #2 so that I can copy a table from #1 into #2 - all
through a function. My Database #2, as part of the start up,...
|
by: Tom Wild |
last post by:
Hi
I am trying to connect to an Access database from a WebPage in VB.Net but
when I try to open the connection I get the following error:
The Microsoft Jet database engine cannot open the file...
|
by: Cheryl Langdon |
last post by:
Hello everyone,
This is my first attempt at getting help in this manner. Please
forgive me if this is an inappropriate request.
I suddenly find myself in urgent need of instruction on how to...
|
by: Mr Seth T |
last post by:
I am supposed to implement a web app in C#/.NET and it needs to be
installed on the customer's server and ran from anywhere. The problem
is this software needs to be licensed by user (i.e. they...
|
by: mike |
last post by:
I help manage a large web site, one that has over
600 html pages... It's a reference site for ham radio
folks and as an example, one page indexes over
1.8 gb of on-line PDF documents.
The site...
|
by: Eric Layman |
last post by:
Hi,
Many years ago when I first learnt abt web dev in school,
I was taught this methodology:
<html>
blah blabh
|
by: Wayne |
last post by:
How do I get rid of the generic Windows "Open File - Security Warning"
that appears when I try to open a database that resides on another PC
on my home network? This is not the annoying macro...
|
by: Steve |
last post by:
I have a database that raises an error when you try to open it and it
doesn't open. Trying to open the database with the OpenDatabase method
raises the same error. Trying to import any objects...
|
by: PinkBishop |
last post by:
I am using VS 2005 with a formview control trying to insert a record
to my access db. The data is submitted to the main table no problem,
but I need to carry the catID to the bridge table...
|
by: zaina |
last post by:
hi everybody
i am nwebie in this forum but i think it is useful for me and the member are helpful
my project is about connecting client with the server to start exchanging messages between...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |