I am working on an automated script that will duplicate an Oracle 7.3.4 table into an Access 97 table. I created the link, wrote the function and macro to perform the emptying and load of the Access table, and am now working on the command line to open the MDB, and run the macro.
The problem is this. The first time I run the macro from within Access, the code works fine, the next time I go to run it, it can't connect to the database. If I run it from the batch file, it fails every time.
The following is the function I wrote (really simple):
The Macro just sets warnings off, runs the code, sets the warnings back on and then quits Access.
The batch file that I wrote to open the MDB and run the macro is:
Any ideas?
Terry M. Hoey
th3856@txmail.sbc.com
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
The problem is this. The first time I run the macro from within Access, the code works fine, the next time I go to run it, it can't connect to the database. If I run it from the batch file, it fails every time.
The following is the function I wrote (really simple):
Code:
Public Function fncRefreshAgentList()
Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "DELETE * FROM AgentList"
DoCmd.RunSQL (strSQL)
strSQL = "INSERT INTO AgentList SELECT * FROM eisadmin_tbl_agent_list"
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings True
End Function
The batch file that I wrote to open the MDB and run the macro is:
Code:
"c:\Program Files\Microsoft Office\Office\msaccess.exe" "H:\temp\training.mdb" /x "mcrUpdateAgentList"
Terry M. Hoey
th3856@txmail.sbc.com
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?