Asked by zimmer9
at 2024-06-07 09:56:37
Point:500 Replies:3 POST_ID:828324USER_ID:10
Topic:
Microsoft Access Database;;SQL Query Syntax
If I run the following query named qry3CopyOpenItemToHistory:
select tblA.* into tblB from tblA
from Microsoft SQL Server Management Studio and table tblB already exists, I get the error:
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'tblB' in the database.
However, I am working with an Access application written using an MDB file type,
and I noticed a macro named mcrImport. Inside the macro,
the Macro Name is Daily.
the Action is: OpenQuery
the Query Name is: qry3CopyOpenItemToHistory
the View is: Datasheet
the Data Mode is: Edit
qry3CopyOpenItemToHistory performs the following as I noted above:
select tblA.* into tblB from tblA
If I run the program over and over again, the macro is executed via the following statement in the application:
DoCmd.RunMacro "mcrimport.daily"
What I don't understand is why, if I run the program a second time, that it repopulates the table tblB with the records from tblA even though the table tblB already exists? I thought that the Access program would generate an error stating that table tblB already exists.
select tblA.* into tblB from tblA
from Microsoft SQL Server Management Studio and table tblB already exists, I get the error:
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'tblB' in the database.
However, I am working with an Access application written using an MDB file type,
and I noticed a macro named mcrImport. Inside the macro,
the Macro Name is Daily.
the Action is: OpenQuery
the Query Name is: qry3CopyOpenItemToHistory
the View is: Datasheet
the Data Mode is: Edit
qry3CopyOpenItemToHistory performs the following as I noted above:
select tblA.* into tblB from tblA
If I run the program over and over again, the macro is executed via the following statement in the application:
DoCmd.RunMacro "mcrimport.daily"
What I don't understand is why, if I run the program a second time, that it repopulates the table tblB with the records from tblA even though the table tblB already exists? I thought that the Access program would generate an error stating that table tblB already exists.