jon100
asked on
Ad hoc access to OLE DB provider 'msdasql' has been denied PLEASE HELP
I have an asp3 page that works fine locally but not on our webserver.
It attempts to import a table from an Access database into a SQL Server 2000 database. Here is the code:
SELECT * INTO myTable FROM(SELECT * FROM OPENROWSET('msdasql', 'DRIVER=Microsoft Access Driver (*.mdb);UserCommitSync=Yes ;Threads=3 ;SafeTrans actions=0
;PageTimeout=5;MaxScanRows =8;MaxBuff erSize=204 8;FIL=MS Access;DriverId=281;Defaul tDir=F:\In etpub\WWWR OOT\emsyst em\system\ admin\dbFi le;DBQ=d:
\Inetpub\WWWROOT\emsystem\ system\adm in\dbFile\ event.mdb' , 'SELECT * FROM Event')) AS newAlias"
Set Rs = Conn.execute(sSQL)
It returns the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Ad hoc access to OLE DB provider 'msdasql' has been denied. You must access this provider through a linked
server.
/emsystem/system/admin/new _event/2-i mport_to_s qlserver.a sp, line 11
Any ideas?
It attempts to import a table from an Access database into a SQL Server 2000 database. Here is the code:
SELECT * INTO myTable FROM(SELECT * FROM OPENROWSET('msdasql', 'DRIVER=Microsoft Access Driver (*.mdb);UserCommitSync=Yes
;PageTimeout=5;MaxScanRows
\Inetpub\WWWROOT\emsystem\
Set Rs = Conn.execute(sSQL)
It returns the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Ad hoc access to OLE DB provider 'msdasql' has been denied. You must access this provider through a linked
server.
/emsystem/system/admin/new
Any ideas?
ASKER
Great thanks.
How come it works locally?
How come it works locally?
ASKER
In linked server properties when I select Jet OLE DB Provider it asks for:
product name:, data source: and Provider string:
what do I need to enter into those?
thanks....
product name:, data source: and Provider string:
what do I need to enter into those?
thanks....
your connection string seems complicated, you may try:
Product Name = Microsoft Access Driver (*.mdb)
Data Source = d:\Inetpub\WWWROOT\emsyste m\system\a dmin\dbFil e\event.md b
Provider String = DRIVER=Microsoft Access Driver (*.mdb);UserCommitSync=Yes ;Threads=3 ;SafeTrans actions=0
;PageTimeout=5;MaxScanRows =8;MaxBuff erSize=204 8;FIL=MS Access;DriverId=281;Defaul tDir=F:\In etpub\WWWR OOT\emsyst em\system\ admin\dbFi le;DBQ=d:\ Inetpub\WW WROOT\emsy stem\syste m\admin\db File\event .mdb
Product Name = Microsoft Access Driver (*.mdb)
Data Source = d:\Inetpub\WWWROOT\emsyste
Provider String = DRIVER=Microsoft Access Driver (*.mdb);UserCommitSync=Yes
;PageTimeout=5;MaxScanRows
ASKER
Ive added the link in but it still comes up with the same error - I think its strange that it works locally but not on the web server.
Could it have anything to do with us using the MS IIS Lockdown & Security Analyser etc? (this is the first time ive ever tested it on the server)
Could it have anything to do with us using the MS IIS Lockdown & Security Analyser etc? (this is the first time ive ever tested it on the server)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the info.
Im running SQL Server 2000 sp3 - have they let the bug slip in again i wonder?!
Im running SQL Server 2000 sp3 - have they let the bug slip in again i wonder?!
Yes, it also applies to SQL Server 2000.....
ASKER
Great thanks a lot!
Goodbye DTS. Be welcomed OPENROWSET.
Thank you.
Thank you.
I agree DTS definately has its quirks. Looks like DTS is going to be MASSIVELY improved in Yukon....
Brett
Brett
ASKER
I have looked at the DisallowAdhocAccess registry key and its set to 0. Do you have any idea how I could get this to work?
Could it have anything to do with the IIS Lockdown tool or the MS Baseline Security Analyser that have been run on our box? I ask this because it works fine locally.
Thanks - sorry it appears I do not have a solution to my problem (I thought the registry fix would do it but have only just found it).
Could it have anything to do with the IIS Lockdown tool or the MS Baseline Security Analyser that have been run on our box? I ask this because it works fine locally.
Thanks - sorry it appears I do not have a solution to my problem (I thought the registry fix would do it but have only just found it).
You must be a wizard to solve it.
At first follow arbert's hint and run reg-file like this
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\MSSQLSe rver\Provi ders]
"DisallowAdhocAccess"=dwor d:00000000
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\MSSQLSe rver\Provi ders\Micro soft.Jet.O LEDB.4.0]
"DisallowAdhocAccess"=dwor d:00000000
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\MSSQLSe rver\Provi ders\MSDAO RA]
"DisallowAdhocAccess"=dwor d:00000000
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\MSSQLSe rver\Provi ders\MSDAS QL]
"DisallowAdhocAccess"=dwor d:00000000
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\MSSQLSe rver\Provi ders\SQLOL EDB]
"DisallowAdhocAccess"=dwor d:00000000
But it was not working still.
At second you must practise witchcraft.
Go to EM->Security->linked servers
->AddNew->ODBC->Provider Properties->Check "Disallow adhoc access"->OK
Add a new server name->OK
Delete the new linked server.
AddNew->ODBC->Provider Properties->Uncheck "Disallow adhoc access"->OK
Add a new server name->OK
Delete the new linked server.
And you are in. Do not ask me how, this witchery is directly from BOL.
You must know the way of reading cryptograms.
At first follow arbert's hint and run reg-file like this
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWA
"DisallowAdhocAccess"=dwor
[HKEY_LOCAL_MACHINE\SOFTWA
"DisallowAdhocAccess"=dwor
[HKEY_LOCAL_MACHINE\SOFTWA
"DisallowAdhocAccess"=dwor
[HKEY_LOCAL_MACHINE\SOFTWA
"DisallowAdhocAccess"=dwor
[HKEY_LOCAL_MACHINE\SOFTWA
"DisallowAdhocAccess"=dwor
But it was not working still.
At second you must practise witchcraft.
Go to EM->Security->linked servers
->AddNew->ODBC->Provider Properties->Check "Disallow adhoc access"->OK
Add a new server name->OK
Delete the new linked server.
AddNew->ODBC->Provider Properties->Uncheck "Disallow adhoc access"->OK
Add a new server name->OK
Delete the new linked server.
And you are in. Do not ask me how, this witchery is directly from BOL.
You must know the way of reading cryptograms.
ASKER
FANTASTIC
Not sure why but it works (like you say). Hopefully MS will get this sorted out.
Thanks again - saved my life!
Not sure why but it works (like you say). Hopefully MS will get this sorted out.
Thanks again - saved my life!
Works great.
Racking my brains how and why is the solution is working
Racking my brains how and why is the solution is working
congratulations for this solution...
You can add your MS Access to a become linked server for your SQL server by the following steps:
Enterprise Manager -> Security -> Linked Servers
right click -> New Linked Server
you can choose between using OLE or ODBC to connect to the Access