Showing posts with label rows. Show all posts
Showing posts with label rows. Show all posts

Thursday, March 22, 2012

Error Description differs when logged with Redirect Rows compared with Debug mode

Hi,

Can any one please tell me how to get the complete error description for example when i dont Redirect Row for Error in OLEDB Source i get a detailed error message with column name as

[RCheck [385]] Error: There was an error with input column "CHECK_STATUS" (456) on input "OLE DB Destination Input" (398). The column status returned was: "The value could not be converted because of a potential loss of data.".

But when I set Redirect Row for error and use the Script component to log them into a Table with ErrorDescription based on ErrorColumnID it only gives me this.

The data value cannot be converted for reasons other than sign mismatch or data overflow.

Thanks

Sat

Can't make the FailComponent and RedirectRow error messages the same with stock OLEDB source component.

If you want to actually redirect AND get the original provider error message that you would get in Fail Component mode, well, that component has yet to be written by Microsoft.

Instead, as you're seeing, when performing redirection using the OLEDB source; only the generic ErrorCode => generic textual description is exposed via ComponentMetaData.GetErrorDescription().

With a custom component of course, you can amend error outputs with additional columns, which is exactly what I have had to do to circumvent this problem.

Monday, March 19, 2012

Error creating linked server to Excel

Hi,
Please help, I'm getting desperate. Any ideas warmly welcomed!
I'm trying to read from a basic excel file (1000 or so rows from
column A) but am having problems. The code I am using is:

Declare @.Return Int
SET NOCOUNT ON

Exec @.Return= [master]..[sp_addlinkedServer] 'READ_XLS', 'EXCEL',
'Microsoft.Jet.OleDB.4.0' , 'e:\jsbackup\RACodes.xls',
NULL, 'EXCEL 8.0'
print 'set up Return : ' + convert(varchar(10),@.Return)
--NB E: is the drive as seen oon the server

EXEC sp_addlinkedsrvlogin
@.rmtsrvname = 'READ_XLS',
@.useself = 'true'
print 'login Return : ' + convert(varchar(10),@.Return)

When I try to read from the (one) excel sheet in the file, via
Select * from [READ_XLS]...RACodes$
or to list what tables/sheets are available, via
exec sp_tables_ex 'READ_XLS'

I get the following error:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
Authentication failed.
[OLE/DB provider returned message: Cannot start your application. The
workgroup information file is missing or opened exclusively by another
user.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80040e4d: Authentication
failed.].

What am I missing?

*Many* thanks in advance.
AndyA few things to check:

Do you have the .xls file already open?
Is e:\jsbackup\RACodes.xls a server path?
I recall that you have to set named ranges for it to appear as tables
in Excel.

I don't know whether it helps but I have written an addin for Excel
that can push the data out from Excel (you are trying to pull it in
from the database). If you can reconsider your design and push it from
Excel you can perhaps use it.

SQL*XL is an addin for Excel that let you manage your database from
Excel. It is an end-user tool but it also lets you record all actions
as a macro (VBA) and therefore you can code/script applications with
it.

Have a look at SQL*XL at www.oraxcel.com

Best regards, Gerrit-Jan Linker
Linker IT Consulting Limited
www.oraxcel.com