CJBIRKIN
Drink!
- Local time
- Today, 16:25
- Joined
- May 10, 2002
- Messages
- 255
Hi,
Can someone tell me if this is possible. I want to use a table in an unlinked database in an sql. It is possible i could link the table to the database but i would rather not.
I've tried the following but i get an error saying TblHub is not recognised.
Am i mistaken in thinking that the table def is a copy of the table data and all or is it just the table design.
Any clues greatfully received.
Cheers
Chris
Can someone tell me if this is possible. I want to use a table in an unlinked database in an sql. It is possible i could link the table to the database but i would rather not.
I've tried the following but i get an error saying TblHub is not recognised.
Am i mistaken in thinking that the table def is a copy of the table data and all or is it just the table design.
Any clues greatfully received.
PHP:
Set DbRep = CurrentDb
Set RstRep = DbRep.OpenRecordset("SELECT TBL_SYNCPATH.* FROM TBL_SYNCPATH;")
Set DbHub = OpenDatabase(RstRep![SYNCHRON-PATH], , False, RstRep![SYNCHRON-PATH])
Set TblHub = DbHub.CreateTableDef("TBL_PATIENT_HUB", , "TBL_PATIENT", RstRep![SYNCHRON-PATH])
Set RstRep = Nothing
StrSQL = "SELECT TblHub.*" _
& " FROM TblHub INNER JOIN TBL_PATIENT ON TblHub.HOSPITAL_NUMBER = TBL_PATIENT.HOSPITAL_NUMBER" _
& " WHERE (((TblHub.NHS_NUMBER)<>[TBL_PATIENT].[NHS_NUMBER]))" _
& " OR (((TblHub.DOB)<>[TBL_PATIENT].[DOB]))" _
& " OR (((TblHub.PATIENT_CREATED_DATE)<>[TBL_PATIENT].[PATIENT_CREATED_DATE]))" _
& " OR (((TblHub.PMH)<>[TBL_PATIENT].[PMH]))" _
& " OR (((TblHub.PATIENT_SEX)<>[TBL_PATIENT].[PATIENT_SEX]))ORDER BY TblHub.HOSPITAL_NUMBER;"
Set RstRep = DbRep.OpenRecordset("SELECT TBL_PATIENT.* FROM TBL_PATIENT;")
Set RstHub = DbHub.OpenRecordset(StrSQL)
Cheers
Chris