OpenDataSource fails - sql-server

I'm trying to export records from SQL Server 2008 to mdb file using OpenDataSource. It works when I log in using Windows authentication. But it fails when I use SQL Server authentication.
This is the error I get
OLE DB provider
"Microsoft.Jet.OLEDB.4.0" for linked
server "(null)" returned message
"Could not delete from specified
tables.". Msg 7320, Level 16, State 2,
Procedure EXPORT_Employee, Line 110
Cannot execute the query "DELETE FROM
employee_export " against OLE DB
provider "Microsoft.Jet.OLEDB.4.0" for
linked server "(null)".

A bit speculative but maybe you need to grant the SQL Server Service Account Write Access to the mdb file and make sure that you don't have it open at the same time.
Edit: A different type of permissions error anyway I think http://blogs.msdn.com/spike/archive/2008/07/23/ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null-returned-message-unspecified-error.aspx

Related

How to fix Linked Server from SQL Server 2016 to Oracle 12c?

I set up a few weeks ago a linked server in my sql server 2016 to my oracle 12c following this guide. It was working properly, but after some windows updates that restarted my machine, it no longer works. I can log into oracle properly through sqlplus and sql developer, but not through sql server. I get the following error:
OLE DB provider "OraOLEDB.Oracle" for linked server "LINKED_ORACLE" returned message "ORA-12154: TNS:could not resolve the connect identifier specified".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "LINKED_ORACLE".
I restarted the SQL Server service, as well as restarted windows again, but still same error. What could have changed in a single restart? How can I fix it and get the linked server working again?
For some reason, SQL SERVER was properly reading the tnsnames.ora file before the restart, but after the restart it stopped. I had to recreate the linked server, and put the whole connection string in the Data Source field for it to work again.
Sample Data Source found here:
Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= server01.mydomain.com)(PORT=1521)))(CONNECT_DATA=(SID=OracleDB)(SERVER=DEDICATED)));

Error when executing SQL scripts with SQL Server authentication

I have some issue when executing scripts in SQL.
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 8.0;Database=D:\Application\myExcel.xls;',
'SELECT * FROM [Sheet1$]')
When I login to SQL Server with Windows authentication, the script above runs successfully.
But when I login to SQL Server with SQL Server authentication (not sa account), the script throw this error:
Msg 7399, Level 16, State 1, Line 8
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 8
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Could anyone please tell me why and how to fix it?
I'm using SQL Server 2012 (x64), Windows Server 2012 R2.
Thank you very much.

Error while calling stored procedure on linked server

I had configured a linked server to enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL server by executing sp_addlinkedserver procedure. After doing that I was trying to execute a procedure on a linked server using the following statement
EXEC [LinkedServer].[DatabaseName].[DatabaseOwner].[StoredProcedure] param1, param2
When I tried to execute the statement mentioned above it threw me the following error
OLE DB provider "SQLNCLI10" for linked server "server name" returned message "Unable to complete login process due to delay in opening server connection".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server "server name".
I tried the following
Check if a linked server has remote access enabled
Increase remote query timeout
Check firewall to see if port was enabled.
What am I missing here? I appreciate your help.

When Executing proc: Cannot fetch a row from OLE DB provider "OraOLEDB.Oracle" for linked server

I have an Oracle linked server in my SQL Server database.
I log into SQL Server using local and then Windows authentication.
As the Administrator (which is the account that set up the linked server) I can query directly or embed in a stored proc and then execute the proc without a problem.
As my named user, which has full administrator rights and also has had all SQL Server Groups on the Windows security settings added, I can query my linked server just fine using either synonyms or the OpenQuery syntax. But if I try to execute one of the stored procedures, it will give me the error messages
Message 1:
The OLE DB provider "OraOLEDB.Oracle" for linked server "<server name>" reported an error. The provider did not give any information about the error.
Message 2:
Cannot execute the query "<query string>" against OLE DB provider "OraOLEDB.Oracle" for linked server "<server name>".
I have searched online and typically people see this emssage when trying to run an ad hoc query. My ad hoc query runs just fine. Still, I applied the solution selected, which was to check the "Allow inprocess" option on the OLEDB Provider. Doing that did not help.
any ideas?
Please enable "Allow in Process" option for the provider by opening up Linked Server > Providers and checking on "Allow in Process". For more detail information, please refer to the following link:
Demystifying SQL-Oracle Distributed Query Issues
http://blogs.msdn.com/b/bindeshv/archive/2008/05/21/demystifying-sql-oracle-distributed-query-issues.aspx
source:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/902f5edf-e357-4ee7-82e8-ea5760882985/cannot-fetch-a-row-from-ole-db-provider-oraoledboracle-for-linked-server-linkedservername?forum=sqldataaccess

Connect Oracle to SQL Server

I am trying to connect Oracle 9i database using SQL Management studio 2008.
I tried this but it doesn't work
EXEC sp_addlinkedserver 'OracleLinkedServer','Oracle','OraOLEDB.Oracle','TestDB';
EXEC sp_addlinkedsrvlogin 'OracleLinkedServer','false','SA','TestUsername','TestPassword';
I am able to create the linked server and it test correctly,
But when I execute this statement:
SELECT sysdate FROM OracleLinkedServer...dual;
...it gives an error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" reported an error. Provider caused a server fault in an external process.
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer". The provider supports the interface, but returns a failure code when it is used.
You should UNCHECKED the Allow inprocess in OraOLEDB.Oracle provider under the Linked Servers node.

Resources