Inquiridor
copiar tabela access via caminho do ficheiro

Pergunta
-
Todas as Respostas
-
-
Olá Jonas,
Podemos resolver isto com um Linked Server.
SP_CONFIGURE 'SHOW ADVANCED OPTION',1 RECONFIGURE WITH OVERRIDE; GO SP_CONFIGURE 'AD HOC DISTRIBUTED QUERIES',1 RECONFIGURE WITH OVERRIDE; SELECT * FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=C:\banco.mdb' )...tabela
Depois é só fazer a carga de dados através de um INSERT.
Você também poderá usar o import and export data.
Abraços.
Se útil, Classifique.
Dhiego Piroto - MCP | MCTS SQL Server 2008 Developer | Email: dhiegopiroto@gmail.com
-
Dhiego
deu este erro:
Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
Msg 7302, Level 16, State 1, Line 5
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".Como faço esse insert?
Você também poderá usar o import and export data.
Mas isso terei que fazer ficheiro a ficheiro né? Assim é so especificar o caminho e voiula :)
Obrigado
Visual Basic 2008 Express Edition SQL Server Management Studio
-
Jonas,
Voce precisa do provider "Microsoft.ACE.OLEDB.12.0" instalado na sua maquina.
Se você estiver usando o SQL 2005 altere para o "Microsoft.JET.OLEDB.4.0"
Tente fazer a criação do linked server pela interface, pode ser mais facil.
Abraços;
Se útil, Classifique,.
Dhiego Piroto - MCP | MCTS SQL Server 2008 Developer | Email: dhiegopiroto@gmail.com
-
Estou a experimentar em xp.
Esta me**** é possivel?
Estou farto de fazer teste e nada. O mais estranhoé não encontrar anda de jeito na net.
Por favor ajudem.
Obrigado
SP_CONFIGURE 'SHOW ADVANCED OPTION',1 RECONFIGURE WITH OVERRIDE; GO SP_CONFIGURE 'AD HOC DISTRIBUTED QUERIES',1 RECONFIGURE WITH OVERRIDE; SELECT * FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=C:\Documents and Settings\\teste.mdb' )...teste
e da-me este erro:
Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install. Msg 15281, Level 16, State 1, Line 5 SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
Visual Basic 2008 Express Edition SQL Server Management Studio