Value from outside DB

K

Katrina

I have a database that will be stored on various people's
hard drives. I have the master version of this database
stored on the network. What I would like to do is to have
the hard drive database look onto the network to get a
value (from a query or form) and display it on a form. (I
am using it to compare versions of the DB)

Is this possible?

Katrina
 
M

Marshall Barton

Katrina said:
I have a database that will be stored on various people's
hard drives. I have the master version of this database
stored on the network. What I would like to do is to have
the hard drive database look onto the network to get a
value (from a query or form) and display it on a form. (I
am using it to compare versions of the DB)


There seems to be a misperception here.

Forms just present a formatted view of data, they are not a
data repository.

Queries are just a mechanism to retrieve (selected) data
from a table, they too are not a data repository.

Tables are where data is stored.

If your question is how to check data in another database
(not necessarily open), then you can use VBA and DAO to open
a recordset that retrieves the selected data. One way might
look something like this air code:

Dim db As DAO.Database
Dim rs As Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT versionfield FROM sometable " _
& "IN ""path to other db"" "
& "WHERE keyfield = " & somevalue
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
If thisversion <> rs!versionfield Then
'different version
End If

rs.Close : Set rs = Nothing
Set db = Nothing
 
K

Katrina

Thanks, I'll try that
-----Original Message-----



There seems to be a misperception here.

Forms just present a formatted view of data, they are not a
data repository.

Queries are just a mechanism to retrieve (selected) data
from a table, they too are not a data repository.

Tables are where data is stored.

If your question is how to check data in another database
(not necessarily open), then you can use VBA and DAO to open
a recordset that retrieves the selected data. One way might
look something like this air code:

Dim db As DAO.Database
Dim rs As Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT versionfield FROM sometable " _
& "IN ""path to other db"" "
& "WHERE keyfield = " & somevalue
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
If thisversion <> rs!versionfield Then
'different version
End If

rs.Close : Set rs = Nothing
Set db = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top