473,320 Members | 2,117 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,320 software developers and data experts.

reading just now and then a value from another database

hi,

every now and then I want to compare a field in a local table to a field in
a table in another database.
but not by linking it permanently.

what would be the simplest approach

thanks for your suggestions

michiel
Jun 27 '08 #1
2 1193
A little code like this -----

Dim DB As DAO.Database
Set DB = Path to your external database
Dim Rst As DAO.Recordset
Set Rst = DB.OpenRecordset("Name Of Table In External database")

Now you can compare in a form that has its recordsource as the local
table ---
If Me!NameOfFieldInLocalTable = Rst!NameOfCorrespondingFieldInExternal Table

Finally Close DB and Rst
Rst.Close
Set Rst = Nothing
Set DB = Nothing

Steve
"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:97***************@read4.inet.fi...
hi,

every now and then I want to compare a field in a local table to a field
in a table in another database.
but not by linking it permanently.

what would be the simplest approach

thanks for your suggestions

michiel


Jun 27 '08 #2
thanks very much:
that works perfectly,
albeit that you cannot take 'path to your external database' to literally.
I had more success with
set DB = DBEngine.Workspaces(0).OpenDatabase('path to your external
database')

but you set me in the right direction
thanks again

michiel
"Mark" <no***@email.comwrote in message
news:xt******************************@earthlink.co m...
>A little code like this -----

Dim DB As DAO.Database
Set DB = Path to your external database
Dim Rst As DAO.Recordset
Set Rst = DB.OpenRecordset("Name Of Table In External database")

Now you can compare in a form that has its recordsource as the local
table ---
If Me!NameOfFieldInLocalTable = Rst!NameOfCorrespondingFieldInExternal
Table

Finally Close DB and Rst
Rst.Close
Set Rst = Nothing
Set DB = Nothing

Steve
"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:97***************@read4.inet.fi...
>hi,

every now and then I want to compare a field in a local table to a field
in a table in another database.
but not by linking it permanently.

what would be the simplest approach

thanks for your suggestions

michiel



Jun 27 '08 #3

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

Similar topics

2
by: entoone | last post by:
I am able to make a selection of information when entering a record, with radio buttons giving the option of yes, or no. Which stores their answer as yes, or no in the database. I then have an...
5
by: Dariusz | last post by:
I have PHP code (below) which reads data from a MySQL format database. The problem I am having is trying to find out when the last ID entry was made. When the script is executed, the $gbID is...
12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
4
by: Andy | last post by:
Hello All: I have a field in the database that is an Image. I have no idea how the data is stored in here (Image, compressed, encrypted, plain text, etc). I am trying to write the contents to...
4
by: Fred West | last post by:
I have a class with a private Int32 data member that gets modified from multiple background threads. To synchronize these modifications I use the lock statement: Int32 count = 0; object...
1
by: Mr. B | last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db We have a commercial program that does our Acounting and Time Sheets (Timberline). At least once a day our Accounting department runs a Script...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
2
by: Derik | last post by:
I've got a XML file I read using a file_get_contents and turn into a simpleXML node every time index.php loads. I suspect this is causing a noticeable lag in my page-execution time. (Or the...
6
by: jcasique.torres | last post by:
Hi everyboy. I trying to create a C promang in an AIX System to read JPG files but when it read just the first 4 bytes when it found a DLE character (^P) doesn't read anymore. I using fread...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.