Working on automating the creation of new tables monthly. This is a client/server relational model, so I want the clients to check the master to verify that the table exists, if not the client is to direct the master to create it. The master will have a null version or an update master of the table to copy itself from. However, I can not figure out how to copy the remote table object and paste it remotely via the client.
I know how to create create a table via tabledefs ect.., but would rather simply copy a premade null table which resides in the master. This way I can keep a conformance amoung the clients and I wouldn't have one rogue client out there creating an old base table by mistake.
Worst case scenario, how can I make a procedural call in my master database from a client.
What I have...
On Error Resume Next()
' Get Database UNC/Path of Master
Dim strmdb As String
Dim strnmdb As String
strmdb = GetDBpath("Main" ' Get the MainDB Path
strnmdb = GetDBpath("MDBName" 'Get the MainDB Name
strmdb = strmdb & strnmdb ' \\server\folder\name.mdb
' Connect
Dim wrk As Workspace
Dim dbTest As Database
Set wrk = DBEngine.Workspaces(0)
Set dbTest = wrk. _
OpenDatabase(strmdb, False, _
False, ";PWD=PASSWORD"
' Execute Copy if Connected
If Err.Number = 0 Then
>>>>>>>>NEED HELP HERE<<<<<<<<<<<<
CopyObject , "Newname", acTable, "Oldname"
End If
' Disconnect & Close
Set wrk = Nothing
Set dbTest = Nothing
I know how to create create a table via tabledefs ect.., but would rather simply copy a premade null table which resides in the master. This way I can keep a conformance amoung the clients and I wouldn't have one rogue client out there creating an old base table by mistake.
Worst case scenario, how can I make a procedural call in my master database from a client.
What I have...
On Error Resume Next()
' Get Database UNC/Path of Master
Dim strmdb As String
Dim strnmdb As String
strmdb = GetDBpath("Main" ' Get the MainDB Path
strnmdb = GetDBpath("MDBName" 'Get the MainDB Name
strmdb = strmdb & strnmdb ' \\server\folder\name.mdb
' Connect
Dim wrk As Workspace
Dim dbTest As Database
Set wrk = DBEngine.Workspaces(0)
Set dbTest = wrk. _
OpenDatabase(strmdb, False, _
False, ";PWD=PASSWORD"
' Execute Copy if Connected
If Err.Number = 0 Then
>>>>>>>>NEED HELP HERE<<<<<<<<<<<<
CopyObject , "Newname", acTable, "Oldname"
End If
' Disconnect & Close
Set wrk = Nothing
Set dbTest = Nothing