Trying to open a SQL Server query but am getting this message:
Ad hoc access to OLE DB provider 'Microsoft.Jet. OLEDB.4.0' has been denied. You must access this provider through a linked server.
Heres the script: - Insert into OpenDataSource(
-
'Microsoft.Jet.OLEDB.4.0',
-
'Data Source="H:\Imran\Capacity Planning 0708\UHL Spells Apr 05 to Sept 07 TEST.xls";
-
Extended properties=Excel 5.0')...[PivotSh$]
-
(Provider_Code, Commissioner_Code, LSS_Flag, Financial_Year, Financial_Month, Qtr,
-
Description_Contract, Activity_Type_Grouped, Sum_of_Spells)
-
-
Select Provider_Code, Commissioner_Code, LSS_Flag, Financial_Year, Financial_Month,
-
Case When Financial_Month between '1' and '3' Then 'Qtr 1'
-
When Financial_Month between '4' and '6' Then 'Qtr 2'
-
When Financial_Month between '7' and '9' Then 'Qtr 3'
-
When Financial_Month between '10' and '12' Then 'Qtr 4' Else '' End as Qtr,
-
Description_Contract,
-
Case When Activity_Type in ('Emergency','Non-elective') Then 'Non-Elective'
-
Else Activity_Type End as Activity_Type_Grouped,
-
SUM(Total_Spells) as Sum_of_Spells
-
-
From [Busobjects].Capacity_Planning.dbo.tbl_BaseLine_UHL_Spells_Trend_0708 a
-
-
Inner Join OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
-
'Data Source="H:\Imran\Capacity Planning 0708\UHL Spells Apr 05 to Sept 07 TEST.xls";
-
Extended properties=Excel 5.0')...[SPECIALTY TREND by Month$] as PR
-
On PR.P1 = Commissioner_Code
-
AND PR.P2 = LSS_Flag
-
AND PR.P3 = Description_Contract
-
AND PR.P4 = (Case When Activity_Type in ('Emergency','Non-elective') Then 'Non-Elective'
-
Else Activity_Type END)
-
-
-
Left Outer Join [Busobjects].Capacity_Planning.dbo.tbl_Refs_Specialty_UHL b
-
on a.Specialty_Code = b.Code
-
-
Left Outer Join [Busobjects].Capacity_Planning.dbo.tbl_Refs_IP_SpecServ_0708 c
-
on a.Specialised_Services_Code = c.SpecServ
-
-
Left Outer Join [Busobjects].Capacity_Planning.dbo.tbl_Refs_IP_HRG_Tariff_0708 d
-
on a.HRG_Code = d.HRGCode
-
-
Group by Provider_Code, Commissioner_Code, LSS_Flag, Financial_Year, Financial_Month,
-
Case When Financial_Month between '1' and '3' Then 'Qtr 1'
-
When Financial_Month between '4' and '6' Then 'Qtr 2'
-
When Financial_Month between '7' and '9' Then 'Qtr 3'
-
When Financial_Month between '10' and '12' Then 'Qtr 4' Else '' End,
-
/*Specialty_Code,*/ Description_Contract, --Activity_Type,
-
Case When Activity_Type in ('Emergency','Non-elective') Then 'Non-Elective'
-
Else Activity_Type End--, HRG_Code + ': '+ d.HRGDesc,
-
--Specialised_Services_Code + ': '+c.Description
2 17363 deepuv04 227
Recognized Expert New Member
Try the following query to read the data from excel sheet - sp_configure 'show advanced options', 1
-
RECONFIGURE
-
GO
-
sp_configure 'Ad Hoc Distributed Queries', 1
-
RECONFIGURE
-
GO
-
-
SELECT *
-
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
-
'Excel 8.0;Database=C:\Documents and Settings\Administrator\Desktop\rolemenu.xls',
-
'SELECT * FROM [Sheet1$] where MenuItemId is not null')
make sure your excelsheet is on server...
for more information visit the following link
** Edit **
Removed link to competing forum site. Please check out our FAQ.
If i run the OpenRowSet Query under sysadmin role it is working perfectly. But if the same query running under public role, then it is not working. It is giving following message like "Ad hoc access to OLE DB provider 'Microsoft.Jet. OLEDB.4.0' has been denied". I am trying to use least privilage account for my application. Do we need sysadmin role to run OpenRowSet query? Kindly help me out to resolve the Issue. Thanks in advance
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Wolfgang Kaml |
last post by:
Hello All,
I have been working on this for almost a week now and I haven't anything up
my sleeves anymore that I could test in addition or change....
Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue,
I am posting this on all of the three newsgroups.
That's the setup:
Windows 2003 Server with IIS and ASP.NET actiavted
Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
|
by: Mahesh Hardikar |
last post by:
Hi ,
I have been trying to connect to access database from SQL Server 7.0.
This machine is having 7.0 as a default instance and 2000 as a named
instance.
Also the machine doesn't have access installed and Microsoft.Jet.4.0
is of version SP8 for Windows 2000
The access database is password protected.
I have tried all, OPENROWSET, OPENDATASOURCE, linked server, and ODBC.
|
by: Jim Andersen |
last post by:
Hope this helps someone.
SQL server 2000. I imported some text into a table.
"insert into tbltst (field1, field2) SELECT field1, field2 FROM
OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=c:\temp;Extended
properties=Text')...tstfile#txt"
It worked great. As long as I was logged in as user sa. When I finished
testing, I began to receive the error:
|
by: Randy |
last post by:
I am trying to relink some Oracle tables in an Access database via VB.NET and ADOX. I receive the following error when executing the cat.ActiveConnection link
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Here is my code
Dim cat As ADOX.Catalog = New ADOX.Catalo
Dim tbl As ADOX.Tabl
Dim OracleConn As String = "Provider=MSDAORA.1;Data Source=xzy;User ID=xyz;Password=xyz
|
by: Ben |
last post by:
I am trying to migrate my vb6.0 over to vb.net. Here is the error that that
I am stuck with:
Public myDB As DAO.Database
.....
path = System.IO.Path.GetFullPath("..")
myDB = WS.OpenDatabase(path & "\access.MDB", False, True)
'after I've created my workspace where WS is my workspace, I opend it up and
vb.net recognized it.
DeckUsers = dbCycDeck.OpenRecordset("USERS")
| |
by: somersbar |
last post by:
hello all,
im trying to connect to a microsoft access database from an ASP.NET web
form.
i keep getting the following error though:
ERROR Could not use
'(unknown)'; file already in use. ERROR Driver's SQLSetConnectAttr failed ERROR
Could not use '(unknown)';
file already in use.
|
by: Wayne Smith |
last post by:
I've come up against a major headache that I can't seem to find a solution
for but I'm sure there must be a workaround and I would really be grateful
of any help.
I'm currently building a web site for a small club I belong to and one of
the features I would like to include is the ability to allow users to upload
image files.
unfortunately the servers web root www folder only allows READ and EXECUTE
permissions, which makes it...
|
by: dancer |
last post by:
Using ASP.net 1.1 and Microsoft Access.
I received the following error message. Why? I have closed the Access
file. I have another very small access file that opens with no trouble with
the same code, except a different name for the file.
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\Accident.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.
|
by: dellis |
last post by:
Problem:
My project was initially created without putting passwords in the connection string. When I added the password in the connection string, it disappears when performing a database fill. I have stepped through the code in debug and the connection string is correct up til the Fill command. Once the fill executes, the password disappears from the connection string. This particular Fill is performed to check that the user is valid for this...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |