Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Table Copy w/o Data OR Remote Procedural Call

Status
Not open for further replies.

Rock6431

Programmer
Mar 23, 2002
56
US
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 , &quot;Newname&quot;, acTable, &quot;Oldname&quot;
End If

' Disconnect & Close
Set wrk = Nothing
Set dbTest = Nothing


 
Hi

Try

DoCmd.CopyObject strmdb, &quot;Newname&quot;, acTable, &quot;Oldname&quot;

Regards
LSTAN

 
Thanks for the suggestion. It copies a local table from the client to the masterdb. It won't copy the table from the master and place it within the master. I was looking to keep from having to transfer the table to the client and then all the way back across the network to the master using this... But... Because I'm only copying the structure and not a table full of data and it is only monthly, I guess I will live with an import of the table to the client from the master and then an export to the master. Then i can delete the copy of that table from the client then verify that the table now exists in the master.

thanks again...
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top