I'm exporting tables from Access database to SQL Server database
(that what i really need is to export xls file data to SQL Server; I don't know if VBA lets us to do it directli, therefore, at-first I export xls file to Access db and then form Access to Server):
DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;SERVER=serverName;UID=login;PWD=password;" _
& "DATABASE=ActiveAccounts", acTable, "tblActiveAccounts2004", "dbo.tblActiveAccounts2004".
If a table with such name already exists in SQL Server database, I'm getting error message:
"ODBC -- call failed... There is already an object named 'dbo.tblActiveAccounts2004' in the database"
How can we check from Access application (via VBA) if the SQL Server table exists and if it does, how can we delete the SQL Server table from Access (via VBA)?
Thank you.
(that what i really need is to export xls file data to SQL Server; I don't know if VBA lets us to do it directli, therefore, at-first I export xls file to Access db and then form Access to Server):
DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;SERVER=serverName;UID=login;PWD=password;" _
& "DATABASE=ActiveAccounts", acTable, "tblActiveAccounts2004", "dbo.tblActiveAccounts2004".
If a table with such name already exists in SQL Server database, I'm getting error message:
"ODBC -- call failed... There is already an object named 'dbo.tblActiveAccounts2004' in the database"
How can we check from Access application (via VBA) if the SQL Server table exists and if it does, how can we delete the SQL Server table from Access (via VBA)?
Thank you.