splaisance
Programmer
Hello!
I have two similar access databases. One has more functions, is linked to an as/400, and resides on the main NT server. The second database does not have as/400 links and is on a remote server. I need to copy the data from three tables in the first database into the second database.
Sometimes my vba code works doing this but sometimes the program simply hangs up. When I look at task manager the program is no longer responding. Below is the snippet of code of how I am connecting to the two databases. Also I am doing the copy from vba module in the first database (on the main server)
Dim TableName As String
Dim wsp As Workspace
Dim dbsOrig As Database
Dim dbsAnother As Database
Dim tdf As TableDef
Dim tdfAnother As TableDef
Dim rsAnother As Recordset
Dim rsOrig As Recordset
Dim fldOrig As Field
Dim qdf As QueryDef
' Return reference to default workspace.
Set wsp = DBEngine.Workspaces(0)
' Return reference to current database.
Set dbsOrig = CurrentDb
' Keep track of the transactions made to the database
wsp.BeginTrans
' Return reference to the remote database
Set dbsAnother = wsp.OpenDatabase("Q:\Mort\LookUp.mdb"
TableName = "Q:\Mort\LookUp.mdb"
Any advice or suggestions would be greatly appreciated!
I have two similar access databases. One has more functions, is linked to an as/400, and resides on the main NT server. The second database does not have as/400 links and is on a remote server. I need to copy the data from three tables in the first database into the second database.
Sometimes my vba code works doing this but sometimes the program simply hangs up. When I look at task manager the program is no longer responding. Below is the snippet of code of how I am connecting to the two databases. Also I am doing the copy from vba module in the first database (on the main server)
Dim TableName As String
Dim wsp As Workspace
Dim dbsOrig As Database
Dim dbsAnother As Database
Dim tdf As TableDef
Dim tdfAnother As TableDef
Dim rsAnother As Recordset
Dim rsOrig As Recordset
Dim fldOrig As Field
Dim qdf As QueryDef
' Return reference to default workspace.
Set wsp = DBEngine.Workspaces(0)
' Return reference to current database.
Set dbsOrig = CurrentDb
' Keep track of the transactions made to the database
wsp.BeginTrans
' Return reference to the remote database
Set dbsAnother = wsp.OpenDatabase("Q:\Mort\LookUp.mdb"
TableName = "Q:\Mort\LookUp.mdb"
Any advice or suggestions would be greatly appreciated!