OPENROWSET Error

Feb 23, 2007

I am trying to execute the following ad-hoc query (I have already configured the remote server to allow ad-hoc queries):

--EXECUTE AS USER = suser_name()
SELECT c.*
INTO #MyTempTable
FROM OPENROWSET('SQLNCLI', 'Server=MyRemoteServer;Trusted_Connection=yes;',
'select * from mydb..mytable (nolock)
where PurchaseOrderID in (''19509114'', ''24075854'')) AS c;

I receive the following error message: Login failed for user 'NT AUTHORITYANONYMOUS LOGON'.

I have admin privileges on the remote box-how can I get this to execute in the context of my account rather than this NT AUTHORITYANONYMOUS LOGON account?

Thanks,
-Dave

View 2 Replies


ADVERTISEMENT

OPENROWSET Error

Mar 25, 2004

I am trying to use OPENROWSET in SQL Server to connect to my Access database, but I keep getting the following error:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: The Microsoft Jet database engine cannot open the file 'X:SetupDatabaseKDB_X2.mdb'. It is already opened exclusively by another user, or you need permission to view its data.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].

I have checked the database, it is not in use, and there is no password set on the database that would prevent me from getting access to it. Any ideas? Here's the syntax I'm using:

SELECT *
FROM OpenRowset('Microsoft.Jet.OLEDB.4.0',
'X:SetupDatabaseKDB_X2.mdb';'Admin';'', subPSEL_PList))

View 3 Replies View Related

Openrowset Error

Jul 22, 2006

I have an access database from which i want to use data in sql server if a table has column with values like 6.32404E-244 i've got an error message like:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' for linked server '(null)' returned invalid data for column '[Microsoft.Jet.OLEDB.4.0].Stoc_Max'

a simple select like 'SELECT * FROM OPENROWSET(.....,table) gives me this error.

View 3 Replies View Related

Error With Openrowset

May 17, 2007

I have a text file, that I need to import to SQL. I am trying to do this using OPENROWSET. This is the qry i use below.



select * from OpenRowset('MSDASQL',
'Driver={Microsoft Text Driver
(*.txt; *.csv)};
DefaultDir=c:edge;',
'select * from
vwConstrLendingLoanDefiDetailReady.txt')



I have created a System DSN, For the microsoft text driver. Anyhow it throws this error:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].



Any idea why?

View 5 Replies View Related

OPENROWSET Error

Apr 15, 2008

Hi, I've been having a really weird error with a one-liner:

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=c:directExport.xls;HDR=YES','SELECT * FROM [directExport$]')

Error:
Server: Msg 7399, Level 16, State 1, Line 2
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 managed to fix this since the account SqlServer was using didn't have right privelages to wwwroot or windir apparently, where the saved excel file was.

However, I wrote a .net page letting me save a gridview as an Excel, and then I tried using that Excel file (same format of information inside) and the error popped up again. I then cut out the information in that excel file (created by my .net page), pasted it into a new excel file and then renamed it, and the new file would work when I ran the query analyzer. The only difference is that in the original excel file created, the lines seperating the cells are not there (the gray ones that are there by default), but I really doubt this is the problem, as gray lines are there just to help the user see the different cells.

This is really puzzling to me. Why would it not work in one file, but when I cut it out and put it into an excel file it would work? I wasn't really sure where to post this, as this could be a .net error, and something's wrong with my saving-gridview-as-excel, but I just wanted to know if this could be related to T-SQL first before I try elsewhere. Thanks!

View 1 Replies View Related

Error Openrowset

Oct 25, 2006

my DMX query is:

INSERT INTO [Analyze Shipments]
(
SKIP,
[Store Id],
[Vendor Name],
[Product Type],
[Days Since Last Shipped],
[Quantity]
)
OPENROWSET('Microsoft.Jet.OLEDB.4.0','Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:data mining va XML212025_0212279DATABASEAccessSavingsMartSavingsMart.mdb;Persist Security Info=False',
'SELECT DISTINCT
"vw_Shipments"."ShipmentID"
AS "Shipment Id",
"vw_Shipments"."DaysSinceLastShipped"
AS "Days Since Last Shipped",
"vw_Shipments"."StoreID"
AS "Store Id",
"vw_Shipments"."Quantity"
AS "Quantity",
"vw_Shipments"."VendorName"
AS "Vendor Name",
"vw_Shipments"."ProductType"
AS "Product Type"
FROM "vw_Shipments"')



and error is:

Error (Data mining): This server is not configured to support the 'microsoft.jet.oledb.4.0' provider used in the OPENROWSET clause.



Can you help me,please?

View 5 Replies View Related

Heterogenuous Error When Using OPENROWSET

Apr 10, 2008

I recieve this error when trying to create my sproc:

Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.

Here is my sql code:

INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\dmhcdfsappsClarifyReportsGeneratedADT007DUMP.xls;', 'SELECT [Case ID], [HC Rec''d Date], [Case Type], [Patient/Provider Last Name],
[Method Of Contact], [Complaint Category], [Complaint Type], [Complaint Details], [Health Plan],
[Medical Group], [RO Determination], [Close Reason], [Close Details], [Compliance], [Summary Resolution] FROM [Sheet1$]')

I'm able to create the sproc when I turn the ANSI_NULL ON but that will cause the return to drop any records that have a null value. I would like it to return all records even if there is a null value in the fields.

Any suggestions would be greatly appreciated.

View 2 Replies View Related

Heterogenuous Error When Using OPENROWSET

Apr 11, 2008

I recieve this error when trying to create my sproc:

Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.

Here is my sql code:

INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\dmhcdfsappsClarifyReportsGeneratedADT007DUMP.xls;', 'SELECT [Case ID], [HC Rec''d Date], [Case Type], [Patient/Provider Last Name],
[Method Of Contact], [Complaint Category], [Complaint Type], [Complaint Details], [Health Plan],
[Medical Group], [RO Determination], [Close Reason], [Close Details], [Compliance], [Summary Resolution] FROM [Sheet1$]')

I'm able to create the sproc when I turn the ANSI_NULL ON but that will cause the return to drop any records that have a null value. I would like it to return all records even if there is a null value in the fields.

I don't know if this helps, but I'm also creating some temp tables in this sproc.

Any suggestions would be greatly appreciated.

View 2 Replies View Related

OPENROWSET To Access Error

Jul 20, 2005

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 namedinstance.Also the machine doesn't have access installed and Microsoft.Jet.4.0is of version SP8 for Windows 2000The access database is password protected.I have tried all, OPENROWSET, OPENDATASOURCE, linked server, and ODBC.These are some of the commands which I have tried but gives followingerror.*******************************************SELECT a.*FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','F:Geerimainilling.mdb';'bhagath';'bhagath', Employee)AS aServer: Msg 7303, Level 16, State 2, Line 1Could not initialize data source object of OLE DB provider'Microsoft.Jet.OLEDB.4.0'.[OLE/DB provider returned message: Cannot start your application. Theworkgroup information file is missing or opened exclusively by anotheruser.]**********************************************SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','DataSource="F:Geerimainilling.mdb";User ID=bhagath;Password=bhagath;JetOLEDB:SystemDatabase="c:WINNTsystem32System.mdw"')...EmployeeServer: Msg 7303, Level 16, State 2, Line 1Could not initialize data source object of OLE DB provider'Microsoft.Jet.OLEDB.4.0'.[OLE/DB provider returned message: Cannot start your application. Theworkgroup information file is missing or opened exclusively by anotheruser.]**********************************************SELECT *FROM OPENROWSET('MSDASQL','Driver={Microsoft Access Driver(*.mdb)};Dbq=F:Geerimainilling.mdb;Uid=bhagath; pwd=bhagath','SELECT*FROM Employee')Server: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'MSDASQL' reported an error.[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified]**********************************************I have tried all possible combinations but most of the time I come upwith Error 7399.In case if anyone has some other syntax and successful with that,please let me knowRegards,Mahesh

View 1 Replies View Related

OpenRowSet And No Columns Error

Jul 31, 2007

Anyone notice an issue in SQL 2005 with openrowset? I get the following error:


Cannot process the object "exec testProc". The OLE DB provider "SQLNCLI" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions on that object.

I have tried to use the set FMTONLY ON option but I get the same error. I understand the openrowset is trying to get meta data, but this seems extremely limiting if you cannot use temp tables. Any insight would be appreciated. Thanks.

example code to produce the error.


create procedure testProc

as

select * into #tmp

from master..sp_who

go



select *

from OPENROWSET('SQLNCLI','Server=sql2005;Trusted_Connection=Yes;Integrated

Security=SSPI;','exec testProc')


View 13 Replies View Related

OPENROWSET Query Will Give Syntax Error - Please Help Me

Feb 28, 2008

I am not able to use WHERE Clause in my query. What am I doing wrong?


Here my query that will generate error:
SELECT * INTO LN_S
FROM OPENROWSET('MSDASQL',
'DSN=SHADOW',
'SELECT * FROM LN_ACCT WHERE trn_dt > '2007-03-08' '

I am getting this error:
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near '2007'.


Here is my query which doesn't generate error:
SELECT * INTO LN_S
FROM OPENROWSET('MSDASQL',
'DSN=SHADOW',
'SELECT * FROM LN_ACCT'

Using SQL Server 2000
DSN to a CACHE database on local network

Thanks in advance,

Sam

View 3 Replies View Related

OPENROWSET Using Visual FoxPro Provider Error 'Could Not Fetch A Row'

Jun 20, 2006

Hi,
I have 2 separate clients experiencing this problem,
Both systems are
1.Win 2000 Server with Small Business Server 2000 (SP4)
2.SQL Server 2000 (SP2 upgraded to SP4, SP4)
3.Exchange
4.IIS etc

We use SQL Server to connect to FoxPro 2.6 Tables.

We are using OPENROWSET as follows:

Select * from openrowset('VFPOLEDB.1','C:Client Data';;,'Select * from cm')

We are now getting this error:
Server: Msg 7330, Level 16, State 2, Line 1 Could not fetch a row from OLE DB provider 'vfpoleDB.1'. OLE DB error trace [OLE/DB Provider 'vfpoleDB.1' IRowset::GetNextRows returned 0x80040155].

The statement worked up until around 20 days ago, which made us think that it may be windows updates/sps/hotfixes, but i have installed the above on a test machine and installed all windows updates and the test machine works AOK.

Has anybody seen this error?

Thanks in advance
Q

View 2 Replies View Related

OPENROWSET Using Visual FoxPro Provider Error 'Could Not Fetch A Row'

Jun 20, 2006

Hi,

I have 2 separate clients experiencing this problem,

Both systems are

Win 2000 Server with Small Business Server 2000 (SP4)
SQL Server 2000 (SP2 upgraded to SP4, SP4)
Exchange
IIS etc

We use SQL Server to connect to FoxPro 2.6 Tables.

We are using OPENROWSET as follows:

Select * from openrowset('VFPOLEDB.1','C:Client Data';;,'Select * from cm')

We are now getting this error:

Server: Msg 7330, Level 16, State 2, Line 1 Could not fetch a row from OLE DB provider 'vfpoleDB.1'. OLE DB error trace [OLE/DB Provider 'vfpoleDB.1' IRowset::GetNextRows returned 0x80040155].

The statement worked up until around 20 days ago, which made us think that it may be windows updates/sps/hotfixes, but i have installed the above on a test machine and installed all windows updates and the test machine works AOK.

Has anybody seen this error?

Thanks in advance

Q

View 7 Replies View Related

OPENROWSET (INSERT) Insert Error: Column Name Or Number Of Supplied Values Does Not Match Table Definition.

Mar 24, 2008

Is there a way to avoid entering column names in the excel template for me to create an excel file froma  dynamic excel using openrowset.
I have teh following code but it works fien when column names are given ahead of time.
If I remove the column names from the template and just to Select * from the table and Select * from sheet1 then it tells me that column names donot match.
 Server: Msg 213, Level 16, State 5, Line 1Insert Error: Column name or number of supplied values does not match table definition.
here is my code...
SET @sql1='select * from table1'SET @sql2='select * from table2'  
IF @File_Name = ''      Select @fn = 'C:Test1.xls'     ELSE      Select @fn = 'C:' + @File_Name + '.xls'        -- FileCopy command string formation     SELECT @Cmd = 'Copy C:TestTemplate1.xls ' + @fn     
-- FielCopy command execution through Shell Command     EXEC MASTER..XP_CMDSHELL @cmd, NO_OUTPUT        -- Mentioning the OLEDB Rpovider and excel destination filename     set @provider = 'Microsoft.Jet.OLEDB.4.0'     set @ExcelString = 'Excel 8.0;HDR=yes;Database=' + @fn   
exec('insert into OPENrowset(''' + @provider + ''',''' + @ExcelString + ''',''SELECT *     FROM [Sheet1$]'')      '+ @sql1 + '')         exec('insert into OPENrowset(''' + @provider + ''',''' + @ExcelString + ''',''SELECT *     FROM [Sheet2$]'')      '+ @sql2 + ' ')   
 
 

View 4 Replies View Related

Openrowset

Nov 20, 2002

How come when I run the script:
select * from openrowset ('MSDASQL', 'Driver=Microsoft Excel Driver (*.xls);DBQ=\inawwwpro01d$atrUploadACK102.xls' , 'select * from [sheet1$]') from Server A I get a RESULT, and when I run from Server B I get the following error:
Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server.
Both servers are using IDENTICAL SQL Logins.
Both servers are SQL 2000 SP2.

When I run the script on Server B logged in as SA, then I get a Result!!!

View 4 Replies View Related

OpenRowset

Mar 7, 2005

I can successfully retreive data using:

Declare @Path varchar(100)
Declare @CommandString varchar(100)
Set @Path = ''
Set @CommandString = 'Select * from [myTable.csv]'

EXEC('SELECT *
from OpenRowset(''MSDASQL'', ''Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=\myServermySharedb' + @Path + ';'',''' + @CommandString + ''')')

Does anyone know an easy method to get column names into a table using OpenRowset :confused:

View 1 Replies View Related

Openrowset

Jan 14, 2008

how can i use openrowset. my aim is to develop a import and export data from diff. server . i am using vb.net 2003 , sql sever 2000.
when i am running
openroeset function with window or server authontication it is showing
'OLE DB provider 'SQLOLEDB' reported an error. The provider did not give any information about the error.


anybuddy help me , pls. tell me the right solution.

View 3 Replies View Related

OPENROWSET

Aug 21, 2007

Hi!
I decided to use OPENROWSET for importing data from an excel file into a sql table.When I import the data,I have a problem:

-not all the data is imported to my sql table
-some values in the sql table are different from the ones in the excel file
For example,a value that in the excel file is:87878787 will be in the SQL table:8.78788e+007.

Can somebody pls tell me what's the problem

View 1 Replies View Related

OpenRowSet BUG?

Jul 23, 2005

Hi Folks,I am trying to load data from a table in MS Access to SQL Server 2000using T-SQL OPENROWSET. When I select data from the remote database (MSAccess) using SQL Query analyzer, the columns do NOT appear in the sameorder as seen in Access directly.For e.g. if Access table has columns Cy, Cx, Cz the output in Queryanalyzer appears as Cx, Cy, Cz. It appears to arrange the fieldsalphabetically. This causes problems when I do a 'insert into select *from' as the field definitions do not agree.Is this a bug or is there a setting in Access/SQL which I am missing?Also, please let me know if there is a workaround for this issue.Thanks in advance!Bhaskar

View 3 Replies View Related

OPENROWSET Only Returns First Row

Oct 15, 2014

I've got some text files that I need to read and make some calculations, before inserting data into a table.

When I use:

Code:
select BulkColumn as txt from openrowset(BULK 'c:Tempdata35.txt', SINGLE_NCLOB) as text

It only retrieves the first row. How can I select all the lines in the file?

View 1 Replies View Related

XML RELATED OPENROWSET

Jun 20, 2008

select @xml = bulkcolumn from openrowset(bulk 'C:Documents and
SettingsKasiDesktopewsrss.xml' , single_blob) as channel



here after bulk instead of giving path, we have to give parameter so that the paramter takes the value from the table.

the tables contains paths of xml files

View 2 Replies View Related

OPENROWSET And EXCEL

Nov 7, 2006

I having an excel file called TEST.XLS (in c: drive) which has 3 columns (c0,c1,c2) & 8 rows
c0 c1 c2
1 a A
2 b B
3 c C
4 d D
5 e E
6 f F
7 g G
8 h H

In sql server i have one table called TEST which has three columns
c0 char(10)
c1 char(10)
c2 char(10)


when i runnig the following query

select *
into TEST from openrowset('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:TEST.xls;HDR=YES',
'select * from [Sheet1$]')



i am getting error like this

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: The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].

Version : Sql server 2000 & Excel 2002

Anybody having any idea why this error occuring?
thanks in advance...
Philkos

View 2 Replies View Related

OPENROWSET To Excel

Jan 14, 2007

Hi Anyone I am new member and happy to be here.

I am having trouble exporting the correct data from sql server to an excel spreadsheet using 'OPENROWSET'

The problem is that although the data from my sql table is say :
'a',1,2,3 , the excel spreadsheet sees the data as :
'a','1,'2,'3 ..1,2,3 are of course numbers NOT text, its just that the driver has put a single appostraphy before the number !

I know there is a bug with the ISAM driver but has anyone managed to solve this or has anyone have any alternatives ?

best regards

Reza

R Khan

View 3 Replies View Related

Openrowset And Excel

Apr 17, 2007

I'm doing an openrowset query on an excel sheet. (Using SQL Server 2005) Everything works great, except that I have one column that has both numeric and text data in the spreadsheet. The query returns that column as datatype varchar but puts nulls in the rows that have numeric data in the spreadsheet.

Any suggestions?

I run:

select *
from openrowset('microsoft.jet.oledb.4.0',
'Excel 8.0;database=[filepathandname],
'select * from [Sheet1$A4:G5000]')

on spreadsheet data that looks like:

Model_id Model_name
. . .
123 t4556
124 x225
125 455
. . .

and get something like . . . .

Model_id Model_name
. . .
123 t4556
124 x225
125 NULL
. . .

View 1 Replies View Related

Openrowset Views

Nov 30, 2007

Hi I have a table like:

LIB TABLENAME TABLEDESCR FIELDNAME FIELDDESCR
BISxxSETALPA0AsometableBS12A0somefield
BISxxSETALPA0AsometablePERCA0somotherfield
BISxxSETALPA1AsomeothertableCMPNA1somefield2
BISxxSETALPA1AsomeothertableMERIA1someotherfield2
BISFFBUAALPA1AanothertablePAARSsomefield3

and would like to create views for each distinct table, using openrowset.
An added complexity is that the library name depends on the company code (i.e. BISxxSET.ALPA0A turns to BIS03SET.ALPA0A for company 03 whereas BSFFBUA.ALPA1A remains intact).

Thanks in advance

Kyriakos

View 4 Replies View Related

OPENROWSET Parms'

Mar 14, 2008

Hi

I've got the following code that uses OPENROWSET but I need to paramaterise the filepaths and its not working:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

BEGIN

declare @dataareaid as varchar(3)
declare @configpath as varchar(100)
declare @configfile as varchar(100)
declare @configformatfile as varchar(100)


set @configfile = 'C:ConfigFileConfigFileMot.txt'
set @configformatfile = 'C:ConfigFileConfigFormatFile.txt'

print @dataareaid
print @configpath
print @configfile
print @configformatfile

set @dataareaid = (SELECT dataareaid
FROM OPENROWSET( BULK @configfile , FORMATFILE = @configformatfile
) AS a)


select *
FROM AX.[P2].dbo.Dimensions Dim
WHEREDim.dataareaid = @dataareaid

END

View 3 Replies View Related

Openrowset And Mdb -Files

Jul 23, 2005

Hy Forum !I tried to do somsthing like this:CREATE PROCEDURE dbo.maches ASselect * from openrowset('Microsoft.Jet.OLEDB.4.0','C: empFehler.mdb'; 'Administrator'; ' ' , Fehlerliste)This user 'Admistrator' exists and there is no password for the .mdbfile. In the end the syntax checker tells me:Fehler 7303: Datenquellenoblekt von OLE DB Provider'Microsoft.Jet.OLEDB.4.0' konnte nicht initialisiert werden.I'm using Access 2000 and SQL Server 7.Thank you

View 1 Replies View Related

XQuery Vs OpenRowset

Apr 5, 2006

Please let me know the advantages and disadvantages of XQuery vsOpenRowSet in SQL Server 2005. Which would be better?Regards,Shilpa

View 1 Replies View Related

Using OPENROWSET With An IP Address

Jan 11, 2007

Hi

I've got an openrowset query that works perfectly if I enter the computer name, but it fails when I enter the IP address.

Is there a setting somewhere that I need to enable to make this happen?

Thanks in advance

View 5 Replies View Related

Use OPENROWSET With Web Address?

Aug 28, 2006

I have an excel file on a web server on a different location to the sql server. I want to use OPENROWSET to query the excel file, but it doesn't seem to like using a URL.

Is this the case, or am I doing it wrong? Works fine when I use a local address (eg c:excelfile.xls) when testing locally, but I need to use a URL in production.

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=http://mydot.com/excelfile.xls','SELECT * FROM [page1$]')

View 1 Replies View Related

Syntax Of OpenRowset With UDL?

Oct 25, 2007



Hi All,

Does anyone know or have a sample of a syntax of OpenRowset using a UDL file?

Regards,
Joseph

View 1 Replies View Related

Why Does OPENROWSET Not Connect?

May 10, 2007

We have lots of OPENROWSET usage here, all with embedded user id's and passwords. In an attempt to find a way to eliminate such a foolish practice I created a system DSN on my PC and tried to use it to connect to our sqlserver 2000 database as follows:



SELECT a.*
FROM OPENROWSET('MSDASQL','DSN=TargetDB',
'SELECT * FROM table1') AS a




Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error. Authentication failed.
[OLE/DB provider returned message: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80040e4d: Authentication failed.].


I thought the reason to create an ODBC system data source was to not have to enter credentials in code but use the credentials in the system DSN. I guess I was wrong. Is there any way to not embed user id's and passwords in OPENROWSET code? Having user id's and passwords in code is dangerous and foolish and I am surprised people do it.

View 4 Replies View Related

OPENROWSET T-SQL Function

Jul 11, 2006

Hi everyone,
I have some doubts about OPENROWSET T-SQL function . According to my knowledges about this, openrowset function provide us to use a data from a different Server only that time that we use this function. After we use this function, there is no any linked server trace on the local server. So is this true ?
I see that everyone use different parameter for this function. For instance, everyone firstly use OLE DB name and then the second srvprovider name changes programmer to programmer, so why ?
And lastly, I wonder about the relationship between ad hoc method and openrowSet function.

Thanks

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved