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

Passing In Some Data to MS Access When Open Database

43
I have two different databases. Both have initial login forms set up that is executed from the startup form. The first database can open the second when a button is clicked on the menu.

I would like to be able to pass in the UserID from the first database to the second when that button is clicked, bypassing the login form in the second and using the UserID there in the second.

I have looked at Interprocess Communications a little bit but have not seen any examples of how this might be done with one Access database calling up another.

I do not want to create a database object of the second database in the first in order to write a value to a table, nor write to a temporary file unless there is some way to confirm that there was not a second user also opening it at the same time. Possibly, along this line of thought, I could somehow get the process ID of the second database when opened by the first and from the first, which is still running, write that process ID and the UserID to a table or temporary txt file; then have the second database identify it's own process ID and match it to that specific record to get the UserID.

Any ideas? Thanks in advance for your input!
Dec 14 '11 #1

✓ answered by NeoPa

You should find all you need in Invoking a Database From the Command Line. It includes an example of passing string data to the database and this is explained more fully in How to use command-line switches in Microsoft Access.

8 2186
ADezii
8,834 Expert 8TB
How, exactly, are you 'Opening' the 2nd Database?
Dec 14 '11 #2
Sedrick
43
Using the Shell command, something like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2.     stDBName = """C:\SomePath\db2.mdb"""
  3.     stAppName = "Msaccess.exe " & stDBName 
  4.     Call Shell(stAppName, vbNormalFocus)
  5.  
Dec 14 '11 #3
ADezii
8,834 Expert 8TB
There is one little Trick that I use when passing Data from one 'Office Component' to another and that is to use the System Registry. I'll write the Data from the Calling Application (Access in your case), then read it from the Receiving Application (also Access). The beauty and simplicity of this approach is that, since you are dealing with Office Components, you can use the built-in SaveSetting() Statement and GetSetting() Function to accomplish this. If you are interested, let me know and I'll show you how it can be done.
Dec 14 '11 #4
NeoPa
32,556 Expert Mod 16PB
You should find all you need in Invoking a Database From the Command Line. It includes an example of passing string data to the database and this is explained more fully in How to use command-line switches in Microsoft Access.
Dec 15 '11 #5
Sedrick
43
The only problem with this approach I think is that potentially two simultaneous calls from two different users would tend to overwrite each other, right? How would the called database know which one to use?

I understand that the Shell command returns the task ID of the called program. Is this the same as the process ID in the Windows Kernel? If I could call the Kernel then from the called database to identify the current process ID I could match up which is which.
Dec 16 '11 #6
Sedrick
43
NeoPa,

Thanks! That /cmd option with the "Command" statement should do the job very well!
Dec 16 '11 #7
NeoPa
32,556 Expert Mod 16PB
I expect so. If not, there is more in that article you may find pertinent to your problem.
Dec 16 '11 #8
NeoPa
32,556 Expert Mod 16PB
As requested the other matters have been split into a separate thread Discussion: Working with Windows' Windows (hWnd etc).
Dec 22 '11 #9

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

Similar topics

1
by: David Gibson | last post by:
Hi, I wonder if anyone can help with the following on a fee paying basis for the the design or development of some type of script or utility or piece of code to do the following work. I wish...
6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
3
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no...
10
by: Edlueze | last post by:
I am developing some Data Access Pages (DAP) using Microsoft Access 2003 on Microsoft Windows XP. When I try to open these pages (located on my C: drive), the display of the data access page is...
2
by: Oriol Tomąs | last post by:
Hi, I want to publish a Web Service who returns a dataset with some data from an Oracle Database. In the view designer I can preview data from my OracleDataAdapter1. It returns 3 rows. ...
1
by: Paul M | last post by:
Hello, I want to to be able to read line by line the contents (ie the html) inside some Data Access Pages I have in a Microsoft Access database. There doesnt seem to be a call I can use in the...
0
by: Tim | last post by:
I am having the exact same problem as below. Has anyone found the solution for this? I believe the solutions lies somewhere in here:...
1
by: brino | last post by:
hi all ! i need to open another database in either a macro or with code in a module. how can i do this ?? thanks brino
6
by: munkee | last post by:
Is there a way to automatically have a web based data access page to start on a new record when you open the page? (Without going to data entry mode in page properties) If I go to data entry mode,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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.