Showing posts with label downloaded. Show all posts
Showing posts with label downloaded. Show all posts

Friday, March 23, 2012

Office Interop Assemblies and SSIS

Hi guys,

I'm trying to write an SSIS script that will create an excel file and append data to it.

I downloaded the Office 2007 PIAs (Primary Interop Assemblies) and installed them on my desktop PC where i'm developing from.

However, and even though the assemblies are in the GAC, they don't appear when you look in "Add Reference" for your script task.

If i create a standard .NET web or windows app and try to "Add Reference" I can find them there.

Am I missing anything obvious?

Thanks for your help in advance

Mike

Do you have the Visual Studio Tools for Office 2007 installed?

Just curious, why create the excel file in the script task?

|||

Mike_Gaziotis wrote:

Hi guys,

I'm trying to write an SSIS script that will create an excel file and append data to it.

I downloaded the Office 2007 PIAs (Primary Interop Assemblies) and installed them on my desktop PC where i'm developing from.

However, and even though the assemblies are in the GAC, they don't appear when you look in "Add Reference" for your script task.

If i create a standard .NET web or windows app and try to "Add Reference" I can find them there.

Am I missing anything obvious?

Thanks for your help in advance

Mike

This should help.

VSA requires DLLs to be in the Microsoft.Net folder (but not all the time)

(http://blogs.conchango.com/jamiethomson/archive/2005/11/02/SSIS_3A00_-VSA-requires-DLLs-to-be-in-the-Microsoft.Net-folder-_2800_but-not-all-the-time_2900_.aspx)

-Jamie

|||

The VSA designer's "Add Reference" dialog does not look for assemblies in the GAC but only in the %ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies and %windir%\Microsoft.NET\Framework\v2.0.50727

We recomend that you copy them to the SQL server location pointed above for the "Add Reference" to work.

|||Thanks very much Jamie and Silviu!
Putting the DLLs in the .NET Folder seems to have done the trick.

In response to jwelch's question: I would have used the standard Data Flow task but it didn't seem to support some of the functionality i needed (ie dynamically building the file path and file name based on content etc)

Thanks again guys

Mike
|||

Actually, that sounds like a great opportunity to use variables or expressions. If you describe your scenario a little more, perhaps there might be some alternative approaches.

Not trying to change your mind on direction, just want to make sure you know what options are available.

|||Hi Jwelch,

Always keen to find out if there are more approaches that i haven't considered. Even if they're not used in this scenario it's good to know of the possibilites

Here are my SSIS job requirements:
- Execute (several) SQL queries which retrieve report data
- Insert the data in worksheets of several excel files
- Save the files by:
a: Putting a timestapt in their name (ie reportA_04072007)
b: storing them in different locations on the server based on the report
(ie %Reports%/ReportA/reportA_04072007.xls)
- Send mails with excel files attached

This is to be a scheduled job managed by the SQL server agent.

It's not a job of enormous complexity i must admit, but i somehow i found myself (perhaps because of me being a developer rather than a DBA by nature) more keen to write code than having to use loops, data flow tasks and all the rest. In fact when i first had the problem with the assemblies i half considered writing a windows app that would do that job and then run that from the sql server agent. And really, is there such a big difference between writing an app or a script-only SSIS job?

Thanks and sorry for the babble
Mike

Saturday, February 25, 2012

ODBC Setup

I have downloaded MS SQL Server for Desktop to upsize my
access database to SQL Server database.
The upsizing is successful and when I setup the DSN
connection. It gives the following error :
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'TIMESWEB\IUSR_TIMESWEB'.
I remember the password. But the username is not
recognised by the SQL Server. Can you please let me know
how I can change the Username & password for MS SQL Server
after installing it. I do not know from where I can
change the username & password.
Kindly assist.
Thanks,
Rajesh.VMSDE does not come with the SQL administrator tools (like Enterprise Manager
or Query Analyzer). In order to manage the database, you need to use T-SQL
commands.
The T-SQL commands that should help you are:
If you want to add a SQL login use the following stored procedures:
sp_password:
http://msdn.microsoft.com/library/d.../>
pz_5x44.asp
sp_addlogin:
http://msdn.microsoft.com/library/d... />
a_0q7i.asp
If you want to use an existing Windows username (ie.
'TIMESWEB\IUSR_TIMESWEB'), then use the following stored procedure to give
the username access to the database:
sp_grantlogin:
http://msdn.microsoft.com/library/d... />
a_0q7i.asp
Brannon Jones
Developer - MDAC
This posting is provided "as is" with no warranties and confers no rights.
"Rajesh" <timesweb@.omantel.net.om> wrote in message
news:01a401c3c3a9$87064410$a001280a@.phx.gbl...
quote:

> I have downloaded MS SQL Server for Desktop to upsize my
> access database to SQL Server database.
> The upsizing is successful and when I setup the DSN
> connection. It gives the following error :
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login
> failed for user 'TIMESWEB\IUSR_TIMESWEB'.
> I remember the password. But the username is not
> recognised by the SQL Server. Can you please let me know
> how I can change the Username & password for MS SQL Server
> after installing it. I do not know from where I can
> change the username & password.
> Kindly assist.
> Thanks,
> Rajesh.V