Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
How can it be that if I rerun an Access application with a macro that performs a SELECT INTO statement, that the table gets repopulated with records, even if the table 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.
Hello zimmer9,
If you run that from within Access and have warnings turned off, the statement will execute
and just recreate the table.
From SQL Server, have you set up your Access file as a "linked server"? If so, then that
functionality just may not be able via SQL Server.
Regards,
Patrick
Hello zimmer9,
If you run that from within Access and have warnings turned off, the statement will execute
and just recreate the table.
From SQL Server, have you set up your Access file as a "linked server"? If so, then that
functionality just may not be able via SQL Server.
Regards,
Patrick
Hello zimmer9,
If you run that from within Access and have warnings turned off, the statement will execute
and just recreate the table.
From SQL Server, have you set up your Access file as a "linked server"? If so, then that
functionality just may not be able via SQL Server.
Regards,
Patrick