Showing posts with label jet. Show all posts
Showing posts with label jet. Show all posts

Friday, March 23, 2012

OPENDATASOURCE: text file as input ?

Version 2000.
How do I do something like the example

SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended
properties=Excel 5.0')...xactions

but use a .txt-file instead ?

I tried building it using Access (that usually works :-) ) and that gives a
connectionstring of:
Text;DSN=Link
Sammenkdningsspecifikation;FMT=Delimited;HDR=NO;I MEX=2;CharacterSet=850;DAT
ABASE=c:\temp
Sourcetablename=link.txt

but I can't seem to "massage" it into working on the sql-server.

If I quick and dirty swap 'Microsoft.Jet.OLEDB.4.0' with 'Text' it gives
error:
Could not locate registry entry for OLE DB provider 'Text'.

tia
/jim"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
news:40bf26a4$0$3050$14726298@.news.sunsite.dk...
> Version 2000.
> How do I do something like the example
> SELECT *
> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended
> properties=Excel 5.0')...xactions
> but use a .txt-file instead ?
> I tried building it using Access (that usually works :-) ) and that gives
a
> connectionstring of:
> Text;DSN=Link
Sammenkdningsspecifikation;FMT=Delimited;HDR=NO;I MEX=2;CharacterSet=850;DAT
> ABASE=c:\temp
> Sourcetablename=link.txt
> but I can't seem to "massage" it into working on the sql-server.
> If I quick and dirty swap 'Microsoft.Jet.OLEDB.4.0' with 'Text' it gives
> error:
> Could not locate registry entry for OLE DB provider 'Text'.
> tia
> /jim

These articles might be helpful - you need a schema.ini file in addition to
the DSN:

http://www.users.drew.edu/skass/sql/TextDriver.htm
http://support.microsoft.com/defaul...kb;EN-US;149090

Simon|||Simon Hayes wrote:
> "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> news:40bf26a4$0$3050$14726298@.news.sunsite.dk...
>> Version 2000.
>> How do I do something like the example
>>
>> SELECT *
>> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
>> 'Data Source="c:\Finance\account.xls";User
>> ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
>>
>> but use a .txt-file instead ?

> These articles might be helpful - you need a schema.ini file in
> addition to the DSN:
> http://www.users.drew.edu/skass/sql/TextDriver.htm
> http://support.microsoft.com/defaul...kb;EN-US;149090

Thx Simon, the links were very helpful.

Here is the solution:

File c:\temp\link.txt
10248;"Vins et alcools Chevalier";7/4/1996 0:00:00
10249;"Toms Spezialitten";7/5/1996 0:00:00
10250;"Hanari Carnes";7/8/1996 0:00:00

File c:\temp\schema.ini
[link.txt]
Format=Delimited(;)
CharacterSet=OEM
ColNameHeader=False
Col1=CustomerNumber Long
Col2=CustomerName Text Width 40
Col3=EntryDate Datetime

SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\temp";Extended properties=Text')...table1#txt

And a link about schema.ini
http://msdn.microsoft.com/library/d...ma_ini_file.asp

But... I can't get it to work with
Format=Delimited(,)
or
Format=CSVDelimited
and
File c:\temp\link.txt
10248,"Vins et alcools Chevalier",7/4/1996 0:00:00
10249,"Toms Spezialitten",7/5/1996 0:00:00
10250,"Hanari Carnes",7/8/1996 0:00:00

or a ";" instead of a ","

But never mind....
/jima|||<snip
> Thx Simon, the links were very helpful.
> Here is the solution:
> File c:\temp\link.txt
> 10248;"Vins et alcools Chevalier";7/4/1996 0:00:00
> 10249;"Toms Spezialitten";7/5/1996 0:00:00
> 10250;"Hanari Carnes";7/8/1996 0:00:00
> File c:\temp\schema.ini
> [link.txt]
> Format=Delimited(;)
> CharacterSet=OEM
> ColNameHeader=False
> Col1=CustomerNumber Long
> Col2=CustomerName Text Width 40
> Col3=EntryDate Datetime
> SELECT *
> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="c:\temp";Extended properties=Text')...table1#txt
> And a link about schema.ini
http://msdn.microsoft.com/library/d...ma_ini_file.asp
> But... I can't get it to work with
> Format=Delimited(,)
> or
> Format=CSVDelimited
> and
> File c:\temp\link.txt
> 10248,"Vins et alcools Chevalier",7/4/1996 0:00:00
> 10249,"Toms Spezialitten",7/5/1996 0:00:00
> 10250,"Hanari Carnes",7/8/1996 0:00:00
> or a ";" instead of a ","
> But never mind....
> /jima

Format=CSVDelimited seems to work fine for me, using your sample above:

[test.txt]
Format=CSVDelimited
CharacterSet=OEM
ColNameHeader=False
Col1=CustomerNumber Long
Col2=CustomerName Text Width 40
Col3=EntryDate Datetime

SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\scripts;Extended properties=Text')...test#txt

What error message do you get?

Simon|||>> But... I can't get it to work with
>> Format=Delimited(,)
>> or
>> Format=CSVDelimited
>> and
>> File c:\temp\link.txt
>> 10248,"Vins et alcools Chevalier",7/4/1996 0:00:00
>> 10249,"Toms Spezialitten",7/5/1996 0:00:00
>> 10250,"Hanari Carnes",7/8/1996 0:00:00
>>
>> or a ";" instead of a ","

> Format=CSVDelimited seems to work fine for me, using your sample
> above:
> [test.txt]
> Format=CSVDelimited
> CharacterSet=OEM
> ColNameHeader=False
> Col1=CustomerNumber Long
> Col2=CustomerName Text Width 40
> Col3=EntryDate Datetime
> SELECT *
> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source=c:\scripts;Extended properties=Text')...test#txt
> What error message do you get?

Hmmm, today it behaves a little different :-) I was sure it gave me a "ole
db error. the provider didnt return any information about what went wrong."
but today it gives me

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Tekstfilspecifikationens feltseparator er
magen til decimalseparatoren eller tekstafgrnseren.]
Which means "The textfile's fieldseparator is the same as the
decimalseparator or the textdelimiter."

But now I can get it to work with ";" and Format=Delimited(;)

thx again,

/jim

OpenDataSource with Microsoft.Jet.OLEDB.4 Excel from stored proced

I have a stored procedure which has the following line:
select * from FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="\\MachineName\shared\account.xls";...Excel 8.0...
This stored procedure was called from a VB application. It's odd that
ONLY when ADO connection user need SA database role
AND \\MachineName\shared\account.xls was physical located in the same
machine of DATABASE
the stored procedure would work.
Otherwise it returned error like:
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: The provider did not give an
y
information about the error.]. 0 7300 -2147217900 Microsoft OLE DB Provider
for SQL Server 01000OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an
error. The provider did not give any information about the error. 0 7399
-2147217900 Microsoft OLE DB Provider for SQL Server 42000
Database is SQL Server 2000 SP4. Registry DisallowAdhocAccess is 0.
Any suggestion?Because the security reson, I don't want ADO connection user has the SA role
,
and Excel file can located in any shared folder in the LAN.
"david" wrote:

> I have a stored procedure which has the following line:
> select * from FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="\\MachineName\shared\account.xls";...Excel 8.0...
> This stored procedure was called from a VB application. It's odd that
> ONLY when ADO connection user need SA database role
> AND \\MachineName\shared\account.xls was physical located in the same
> machine of DATABASE
> the stored procedure would work.
> Otherwise it returned error like:
> OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
> IDBInitialize::Initialize returned 0x80004005: The provider did not give
any
> information about the error.]. 0 7300 -2147217900 Microsoft OLE DB Provide
r
> for SQL Server 01000OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an
> error. The provider did not give any information about the error. 0 7399
> -2147217900 Microsoft OLE DB Provider for SQL Server 42000
> Database is SQL Server 2000 SP4. Registry DisallowAdhocAccess is 0.
> Any suggestion?
>sql

OpenDataSource with Microsoft.Jet.OLEDB.4 Excel from stored proced

I have a stored procedure which has the following line:
select * from FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="\\MachineName\shared\account.xls";...Excel 8.0...
This stored procedure was called from a VB application. It's odd that
ONLY when ADO connection user need SA database role
AND \\MachineName\shared\account.xls was physical located in the same
machine of DATABASE
the stored procedure would work.
Otherwise it returned error like:
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: The provider did not give any
information about the error.]. 0 7300 -2147217900 Microsoft OLE DB Provider
for SQL Server 01000OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an
error. The provider did not give any information about the error. 0 7399
-2147217900 Microsoft OLE DB Provider for SQL Server 42000
Database is SQL Server 2000 SP4. Registry DisallowAdhocAccess is 0.
Any suggestion?Because the security reson, I don't want ADO connection user has the SA role,
and Excel file can located in any shared folder in the LAN.
"david" wrote:
> I have a stored procedure which has the following line:
> select * from FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="\\MachineName\shared\account.xls";...Excel 8.0...
> This stored procedure was called from a VB application. It's odd that
> ONLY when ADO connection user need SA database role
> AND \\MachineName\shared\account.xls was physical located in the same
> machine of DATABASE
> the stored procedure would work.
> Otherwise it returned error like:
> OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
> IDBInitialize::Initialize returned 0x80004005: The provider did not give any
> information about the error.]. 0 7300 -2147217900 Microsoft OLE DB Provider
> for SQL Server 01000OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an
> error. The provider did not give any information about the error. 0 7399
> -2147217900 Microsoft OLE DB Provider for SQL Server 42000
> Database is SQL Server 2000 SP4. Registry DisallowAdhocAccess is 0.
> Any suggestion?
>

OpenDataSource to Excel

OpenDataSource does not work:
SELECT * FROM
OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\temp\TEST.XLS;Extended properties=Excel 5.0')...[Tabelle1$]
The error message is:
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
returned message "Unspecified 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)".
On our newest installation with Windows2003Server SP2 running with
SQLServer2005 SP2 the select-statement fails.
(On WindowsXP SP2 with SQLServer2005 SP2 its still working fine)
SQLServer-Service is running as a local-user that is an administrator
The user calling the select-statement is the same local-user
The Excel-File is on a local drive
Georg
Yes, I have seen this error many times and could not be able to solve the
problem. It worked just fine on SS2000 and does not on SS2005.
What if you create SSIS package to move the data?
"Georg" <Georg@.discussions.microsoft.com> wrote in message
news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
> OpenDataSource does not work:
> SELECT * FROM
> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source=c:\temp\TEST.XLS;Extended properties=Excel
> 5.0')...[Tabelle1$]
> The error message is:
> OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
> returned message "Unspecified 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)".
> On our newest installation with Windows2003Server SP2 running with
> SQLServer2005 SP2 the select-statement fails.
> (On WindowsXP SP2 with SQLServer2005 SP2 its still working fine)
> SQLServer-Service is running as a local-user that is an administrator
> The user calling the select-statement is the same local-user
> The Excel-File is on a local drive
>
>
|||Thank you for quick reply !
I'm afraid SSIS package is no solution for me...
"Uri Dimant" wrote:

> Georg
> Yes, I have seen this error many times and could not be able to solve the
> problem. It worked just fine on SS2000 and does not on SS2005.
> What if you create SSIS package to move the data?
>
> "Georg" <Georg@.discussions.microsoft.com> wrote in message
> news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
>
>
|||"Uri Dimant" <urid@.iscar.co.il> wrote in
news:OT1SVhsnIHA.5944@.TK2MSFTNGP03.phx.gbl:
[vbcol=seagreen]
> Georg
> Yes, I have seen this error many times and could not be able to solve
> the problem. It worked just fine on SS2000 and does not on SS2005.
> What if you create SSIS package to move the data?
>
> "Georg" <Georg@.discussions.microsoft.com> wrote in message
> news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
FWIW, the analogous
SELECT * FROM
OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\Documents and Settings\Chris\My Documents\RSJ.xls;Extended
properties=Excel 5.0')...[Sheet1$]
works fine for me with SQL Server 2005 Express.
|||We could not reproduce the problem on a Test-Server with W2003Server/SP2 +
SS2005/SP2 - here it works fine also. Currently we try to find further
difference(s) between Test- and Production-Server
"Chris.Cheney" wrote:

> "Uri Dimant" <urid@.iscar.co.il> wrote in
> news:OT1SVhsnIHA.5944@.TK2MSFTNGP03.phx.gbl:
>
> FWIW, the analogous
> SELECT * FROM
> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source=c:\Documents and Settings\Chris\My Documents\RSJ.xls;Extended
> properties=Excel 5.0')...[Sheet1$]
> works fine for me with SQL Server 2005 Express.
>

OpenDataSource to Excel

OpenDataSource does not work:
SELECT * FROM
OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\temp\TEST.XLS;Extended properties=Excel 5.0')...[Tabelle1$]
The error message is:
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
returned message "Unspecified 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)".
On our newest installation with Windows2003Server SP2 running with
SQLServer2005 SP2 the select-statement fails.
(On WindowsXP SP2 with SQLServer2005 SP2 its still working fine)
SQLServer-Service is running as a local-user that is an administrator
The user calling the select-statement is the same local-user
The Excel-File is on a local driveGeorg
Yes, I have seen this error many times and could not be able to solve the
problem. It worked just fine on SS2000 and does not on SS2005.
What if you create SSIS package to move the data?
"Georg" <Georg@.discussions.microsoft.com> wrote in message
news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
> OpenDataSource does not work:
> SELECT * FROM
> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source=c:\temp\TEST.XLS;Extended properties=Excel
> 5.0')...[Tabelle1$]
> The error message is:
> OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
> returned message "Unspecified 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)".
> On our newest installation with Windows2003Server SP2 running with
> SQLServer2005 SP2 the select-statement fails.
> (On WindowsXP SP2 with SQLServer2005 SP2 its still working fine)
> SQLServer-Service is running as a local-user that is an administrator
> The user calling the select-statement is the same local-user
> The Excel-File is on a local drive
>
>|||Thank you for quick reply !
I'm afraid SSIS package is no solution for me...
"Uri Dimant" wrote:
> Georg
> Yes, I have seen this error many times and could not be able to solve the
> problem. It worked just fine on SS2000 and does not on SS2005.
> What if you create SSIS package to move the data?
>
> "Georg" <Georg@.discussions.microsoft.com> wrote in message
> news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
> > OpenDataSource does not work:
> >
> > SELECT * FROM
> > OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> > 'Data Source=c:\temp\TEST.XLS;Extended properties=Excel
> > 5.0')...[Tabelle1$]
> >
> > The error message is:
> > OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
> > returned message "Unspecified 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)".
> >
> > On our newest installation with Windows2003Server SP2 running with
> > SQLServer2005 SP2 the select-statement fails.
> > (On WindowsXP SP2 with SQLServer2005 SP2 its still working fine)
> >
> > SQLServer-Service is running as a local-user that is an administrator
> > The user calling the select-statement is the same local-user
> > The Excel-File is on a local drive
> >
> >
> >
>
>|||"Uri Dimant" <urid@.iscar.co.il> wrote in
news:OT1SVhsnIHA.5944@.TK2MSFTNGP03.phx.gbl:
> Georg
> Yes, I have seen this error many times and could not be able to solve
> the problem. It worked just fine on SS2000 and does not on SS2005.
> What if you create SSIS package to move the data?
>
> "Georg" <Georg@.discussions.microsoft.com> wrote in message
> news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
>> OpenDataSource does not work:
>> SELECT * FROM
>> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
>> 'Data Source=c:\temp\TEST.XLS;Extended properties=Excel
>> 5.0')...[Tabelle1$]
FWIW, the analogous
SELECT * FROM
OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\Documents and Settings\Chris\My Documents\RSJ.xls;Extended
properties=Excel 5.0')...[Sheet1$]
works fine for me with SQL Server 2005 Express.|||We could not reproduce the problem on a Test-Server with W2003Server/SP2 +
SS2005/SP2 - here it works fine also. Currently we try to find further
difference(s) between Test- and Production-Server
"Chris.Cheney" wrote:
> "Uri Dimant" <urid@.iscar.co.il> wrote in
> news:OT1SVhsnIHA.5944@.TK2MSFTNGP03.phx.gbl:
> > Georg
> > Yes, I have seen this error many times and could not be able to solve
> > the problem. It worked just fine on SS2000 and does not on SS2005.
> > What if you create SSIS package to move the data?
> >
> >
> > "Georg" <Georg@.discussions.microsoft.com> wrote in message
> > news:63193B94-1355-44C4-A38E-A645A3F343E1@.microsoft.com...
> >> OpenDataSource does not work:
> >>
> >> SELECT * FROM
> >> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> >> 'Data Source=c:\temp\TEST.XLS;Extended properties=Excel
> >> 5.0')...[Tabelle1$]
> FWIW, the analogous
> SELECT * FROM
> OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source=c:\Documents and Settings\Chris\My Documents\RSJ.xls;Extended
> properties=Excel 5.0')...[Sheet1$]
> works fine for me with SQL Server 2005 Express.
>

OPENDATASOURCE Problems (permission)

Hi all,
I am running SQL2000 SP4 and want to run the command:
SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
with members"
logged in as "sa" it is fine but when another user no "sa" runs I get:
Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied.
You must access this provider through a linked server.
Can anyone help me? The user that will run that is not "sa"
thanks
JulioJulio
http://support.microsoft.com/kb/327489
"Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
> Hi all,
> I am running SQL2000 SP4 and want to run the command:
> SELECT *
> FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
> Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
> with members"
> logged in as "sa" it is fine but when another user no "sa" runs I get:
> Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been
> denied.
> You must access this provider through a linked server.
> Can anyone help me? The user that will run that is not "sa"
> thanks
> Julio|||Hi Uri,
thanks for that, I created a new registry entry (DisallowAdHocAccess) under
'Microsoft Jet 4.0 OLE DB Provider' set to 0 and it's working fine. The key
is the DisallowAdHocAccess for each provider.
thanks
Julio M
"Uri Dimant" wrote:
> Julio
> http://support.microsoft.com/kb/327489
>
> "Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
> news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
> > Hi all,
> >
> > I am running SQL2000 SP4 and want to run the command:
> >
> > SELECT *
> > FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
> > Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
> > with members"
> >
> > logged in as "sa" it is fine but when another user no "sa" runs I get:
> >
> > Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been
> > denied.
> > You must access this provider through a linked server.
> >
> > Can anyone help me? The user that will run that is not "sa"
> >
> > thanks
> > Julio
>
>

OPENDATASOURCE Problems (permission)

Hi all,
I am running SQL2000 SP4 and want to run the command:
SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
with members"
logged in as "sa" it is fine but when another user no "sa" runs I get:
Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied.
You must access this provider through a linked server.
Can anyone help me? The user that will run that is not "sa"
thanks
Julio
Julio
http://support.microsoft.com/kb/327489
"Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
> Hi all,
> I am running SQL2000 SP4 and want to run the command:
> SELECT *
> FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
> Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
> with members"
> logged in as "sa" it is fine but when another user no "sa" runs I get:
> Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been
> denied.
> You must access this provider through a linked server.
> Can anyone help me? The user that will run that is not "sa"
> thanks
> Julio
|||Hi Uri,
thanks for that, I created a new registry entry (DisallowAdHocAccess) under
'Microsoft Jet 4.0 OLE DB Provider' set to 0 and it's working fine. The key
is the DisallowAdHocAccess for each provider.
thanks
Julio M
"Uri Dimant" wrote:

> Julio
> http://support.microsoft.com/kb/327489
>
> "Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
> news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
>
>

OPENDATASOURCE Problems (permission)

Hi all,
I am running SQL2000 SP4 and want to run the command:
SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
with members"
logged in as "sa" it is fine but when another user no "sa" runs I get:
Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied.
You must access this provider through a linked server.
Can anyone help me? The user that will run that is not "sa"
thanks
JulioJulio
http://support.microsoft.com/kb/327489
"Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
> Hi all,
> I am running SQL2000 SP4 and want to run the command:
> SELECT *
> FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data
> Source="f:\jackpot\jackpot.mdb"; User ID=Admin;Password=')..."master table
> with members"
> logged in as "sa" it is fine but when another user no "sa" runs I get:
> Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been
> denied.
> You must access this provider through a linked server.
> Can anyone help me? The user that will run that is not "sa"
> thanks
> Julio|||Hi Uri,
thanks for that, I created a new registry entry (DisallowAdHocAccess) under
'Microsoft Jet 4.0 OLE DB Provider' set to 0 and it's working fine. The key
is the DisallowAdHocAccess for each provider.
thanks
Julio M
"Uri Dimant" wrote:

> Julio
> http://support.microsoft.com/kb/327489
>
> "Julio Mattos" <JulioMattos@.discussions.microsoft.com> wrote in message
> news:732AD50A-E369-49E4-AE60-A5256075C37B@.microsoft.com...
>
>

Monday, March 12, 2012

Open Excel File

hey
I am just trying a simple query of an Excel file.

Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\MyFile.xls;HDR=YES', 'SELECT * FROM [Sheet1$]')

and i am getting this error

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].

I know for a fact that the path is correct and that it is the path of the server. So what is the problem with this??

tibordoes someone have the spreadsheet open?|||nope not at all|||oh ok i found out the issue. i was using vb with excel and was terminating the debug program without closing out excel so i had several in memory still