Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Excel 64 bit driver Expand / Collapse
Author
Message
Posted Monday, January 14, 2013 11:51 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, May 15, 2014 2:05 PM
Points: 73, Visits: 475
Hi all,
I am running the following query in sql server 2008 r2(64-bit),
MS office 2007 excel file.
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=<loc>',
'SELECT * FROM [Sheet1$]')

its showing error
Msg 7308, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.


i run the following code
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO


but still its showing the same error...
any help....



thanks and regards
Sathiyan R
Post #1407044
Posted Tuesday, January 15, 2013 2:03 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:45 AM
Points: 3,614, Visits: 5,227
Check to make sure MS Office, your Windows OS and SQL Server are all either 32 bit or 64 bit and then download the correct set of Jet drivers from the MS site http://www.sqlservercentral.com/Forums/Topic1393640-1292-1.aspx

You must have all 3 running in the same mode. The driver won't allow you to install 32 bit in a 64 bit environment.



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1407091
Posted Tuesday, January 15, 2013 2:07 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,293, Visits: 10,162
dwain.c (1/15/2013)

You must have all 3 running in the same mode. The driver won't allow you to install 32 bit in a 64 bit environment.


You can install a 32-bit JET provider in a 64-bit environment. However, if you have 64-bit Office installed (which you shouldn't on a server), then you can't install the 32-bit provider or vice versa.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1407093
Posted Tuesday, January 15, 2013 2:32 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:45 AM
Points: 3,614, Visits: 5,227
Koen Verbeeck (1/15/2013)
dwain.c (1/15/2013)

You must have all 3 running in the same mode. The driver won't allow you to install 32 bit in a 64 bit environment.


You can install a 32-bit JET provider in a 64-bit environment. However, if you have 64-bit Office installed (which you shouldn't on a server), then you can't install the 32-bit provider or vice versa.


Koen - I confess you caught me speculating a bit. When I was doing this, I was doing it on my laptop and I couldn't sort the problem until all were in sync. Thanks for setting the record straight.



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1407109
Posted Tuesday, January 15, 2013 2:32 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, May 15, 2014 2:05 PM
Points: 73, Visits: 475
In some websites i seen that 64 bit is only from MSoffice 2010.But I'm using 2007 so it's 32 bit right.
and OS windows 7 (64 bit)
SQL SERVER 2008 R2(64 bit)
Post #1407110
Posted Tuesday, January 15, 2013 2:58 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,293, Visits: 10,162
I think you can use the 2010 ACE OLE DB driver to read from 2007 workbooks. It's possible you'd have to change the Excel version in the connection string.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1407118
Posted Tuesday, January 15, 2013 3:04 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:45 AM
Points: 3,614, Visits: 5,227
Koen Verbeeck (1/15/2013)
I think you can use the 2010 ACE OLE DB driver to read from 2007 workbooks. It's possible you'd have to change the Excel version in the connection string.


To read Excel 2007 (.xlsx files), I believe you need this as the first two arguments to OPENROWSET:

SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;HDR=NO;Database=filename.xlsx,'SELECT * FROM [Sheet1$]')





My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1407120
Posted Tuesday, January 15, 2013 3:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, May 15, 2014 2:05 PM
Points: 73, Visits: 475
its showing error
Msg 7302, Level 16, State 1, Line 1
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Post #1407132
Posted Tuesday, January 15, 2013 3:42 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:45 AM
Points: 3,614, Visits: 5,227
sathiyan00 (1/15/2013)
its showing error
Msg 7302, Level 16, State 1, Line 1
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".


Chances are pretty good that you either haven't specified the right path to the file or you still have it open in Excel.



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1407138
Posted Tuesday, January 15, 2013 3:51 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, May 15, 2014 2:05 PM
Points: 73, Visits: 475
no excel is not open,and the path also correct.

i run the following code
EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1
GO
EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
GO

After that it shows
Msg 7308, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.ACE.OLEDB.12.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.
Post #1407143
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse