May 7, 2008 at 6:01 am
Hello comunity
i have the following TSQL Command :
SELECT * INTO CU FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\prov\EXTRUVERDE_CCustos e Naturezas_Final para importar_JALVES.xls', [DBEXT$])
But , SQL server return this error, how to resolve :
Msg 15281, Level 16, State 1, Line 3
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.
May 7, 2008 at 7:45 am
You need to go into SQL Server Surface Area Configuration and then into Surface Area Configuration for Features and check the enable Openrowset and Opendatasource support selection under Ad Hoc Remote Queries. This is disabled by default in SQL Server 2005.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
May 7, 2008 at 7:59 am
Thanks Jack
I will try
Luis Santos
May 7, 2008 at 4:22 pm
Hello Jack
I make what you said in your last reply , but now i have an another error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.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 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
What the problem now, could you give me.
Thanks
Luis Santos
May 8, 2008 at 11:53 am
Hello comunity
I read on google, many persons that have the same problem, but any response reolve them.
Could someone give me a little help.
Note : my OS is Windows Vista an i have Office 2007 professional
Many thanks again
Luis Santos
May 7, 2009 at 10:35 am
You need to enable OLE DB from Surface area configuration. Restart SQL Server services and it should work.
November 14, 2009 at 8:18 pm
Hi this type of error will occur for differen reasons.
check if your Filename and path is correct.
Ensure that there is no spell mistakes.
if your file name database path is correct verify your connection string
if your connection is correct then verify there are no of columns in excel and sql server is correct.
if no of columns in excel and sql server then
verify if your excel is open.if it is opened just close the excel. and run the quey
Malleswarareddy
I.T.Analyst
MCITP(70-451)
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply