Sql Or Link To Import Cells/ranges (excel 2003) To Sql Server 2005

Feb 27, 2008

I have around 600 worksheets that i need to import into sql server that are in a somewhat non-table like format. Data defractor seems to be able to do what i need, but i also need to check into doing it manually. I've seen the code to import cells and ranges into sql server, but can't seem to remember what it is anymore. I've also searched through the forums and can't seem to find any examples either. Could anyone post an example or a link with some examples or explaination code. Thanks in advance.

View 4 Replies


ADVERTISEMENT

TSQL + VBA Excel 2003 - Importing Data From MS Excel 2003 To SQL SERVER 2000 Using Multi - Batch Processing

Sep 11, 2007

Hi,
I need to import an SQL string from MS Excel 2003 to SQL SERVER 2000.
The string I need to import is composed by 5 different several blocks and looks like:



Code Snippet

CommandLine01 = "USE mydb"
CommandLine02 = "SELECT Block ..."
CommandLine03 = "GO
ALTER TABLE Block...
GO"
CommandLine04 = "UPDATE Block..."
CommandLine05 = "SELECT Block..."

The detail of the SQL string is at:
http://forums.microsoft.com/msdn/showpost.aspx?postid=2093921&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1



I am trying to implement OJ's suggestion:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2117223&SiteID=1
to use multi - batch processing to import the string to SQL SERVER, something like:




Code Snippet
Dim SqlCnt, cmd1, cmd2, cmd3
'set the properties and open a connection

cmd1="use my_db"
cmd2="create table mytb"
cmd3="insert into mytb"

SqlCnt.execute cmd1
SqlCnt.Execute cmd2
SqlCnt.Execute cmd3

Below is the code (just partial) I have, and I need help to complete it.
Thanks in advance,
Aldo.




Code Snippet
Function TestConnection()
Dim ConnectionString As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet

ConnectionString = "Driver={SQL Server};Server=myServer;Database=myDBName;Uid=UserName;Pwd=Password"
ConnectionString.Open

CmdLine01 = " USE " & myDB
CmdLine02 = " SELECT ACCOUNTS.FULLNAME FROM ACCOUNTS" ...

CmdLine03 = "GO
ALTER TABLE Block...
GO"

CmdLine04 = "UPDATE Block..."
CmdLine05 = "SELECT Block..."

RecordSet.Open CmdLine01, ConnectionString
RecordSet.Open CmdLine02, ConnectionString

ConnectionString.Execute CmdLine01
ConnectionString.Execute CmdLine02

'Retrieve Field titles
For ColNr = 1 To RecordSet.Fields.Count
ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name
Next

ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet

'Close ADO objects
RecordSet.Close
ConnectionString.Close
Set RecordSet = Nothing
Set ConnectionString = Nothing

End Function






View 7 Replies View Related

Import Data From Access 2003 To SQL Server 2005 Via T SQL ?

Oct 5, 2007

I have a customer using a web app where the data is drawn from a database in SQL Server 2005.

In addition to its normal tables, the database has two lookup tables which are deleted, recreated, and repopulated once a week. The data for these two tables comes from two queries in an Access database which essentially turn many related tables into two flat tables.

I know this can be done with SSIS, I've done it, I suppose it could be done witth SSMA for Access, but could this operation be done with a stored prodecure ? Most steps would not be a problems. They would be:

- Drop the two tables in SQL Server (no problem)
- Recreate them (no problem, maybe better to just delete all existing records, either way)

- Connect to the query in the Access database (here is where I have questions)
- Simply do an INSERT from the Access query to the SQL table.

So my question is whether we can connect to an Acess query from a stored proc, I suppose using ODBC.

Can this be done? If so how? Are there any papers on this topic?

Msny thanks,
Mike Thomas

View 5 Replies View Related

Reg: Export Excel 2003 To Sql Server 2005

Mar 31, 2008

I want to export Excell 2003 to Sql Server 2005. I am having the following error while execute the query.


declare @SQL varchar(8000)
create table #temp(i int identity(1,1),SiteName varchar(100),SiteDescription varchar(5000),SiteURL varchar(500),CategoryName varchar(200))
set @SQL='Insert into #temp Select * From OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;Database=' +
'a.xls' +';HDR = YES;IMEX=0'',''SELECT * FROM [Sheet1$]'')'

exec (@SQL)



The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the 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)".

I need a solution urgently. help Pls

View 3 Replies View Related

Is There A Way To Import Tables From Microsoft Access 2003 With SQL Server 2005 Express?

Apr 21, 2006

Hi,

I've just installed SQL Server 2005 Express Advanced and I haven't found a way to import Microsoft Access 2003 files. Is there a way to do it?

Thanks in advance,

Sergio Oliveira

View 1 Replies View Related

Importing Data From Excel 2003 To Sql Server 2005

Sep 3, 2007

Hi all. I want to export data from excel 2003 to sql server 2005. I am using the following script:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
Insert into Pamphlet
Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:Pamphlet.xls;HDR=YES', 'SELECT * FROM [Sheet3$]')
But it is giving the following error:
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
The above script is working fine with Excel 2002 but not with 2003. Can someone please provide me exact script of importing data from excel 2003 to sql server 2005. I have also tried the Linked server option but it is still giving the same error.
Please help me.  
 
 

View 1 Replies View Related

SQL 2005 X64 Linked Server To Excel 2003/2007

Aug 27, 2007

Is there a way to create a SQL 2005 x64 Linked server to an Excel (or Access) 2003/2007 file? In SQL 2005 32bit this was possible. Does anyone know of a solution or a work around?

View 3 Replies View Related

How To Link To An Existing SQLExpress 2005 Table From Access 2003

Nov 22, 2006

I initially created an Access application within Access 2003 which I subsequently migrated to SQLExpress 2005 (Tables only) using Microsoft SQL Migration Assistance for Access 2003 (SSMAA) and continue to use Access 2003 as a front end, this really was easy and worked perfect. Now I added a new table to my SQLExpress DB and need to link to it from my Access application but can not find a way to do so in the same way that the SSMAA does. I need to run the Access 2003 application in share mode from multiple PC in the LAN. If I try linking to the table using an ODBC connection I can only access from the PC where the link was done! Any ideas? THanks in advance.

View 4 Replies View Related

Cannot Link To SQL Tables Using ODBC Link Table In Access 2003

Feb 3, 2006

When trying to link to an SQL table in Access 2003, the software appears to be malfunctioning. 

The sequence of events is File - Get External Data - Link Tables - Files of Type: ODBC Databases().

The Problem: On two of my computers, the select data source window does not pop up, preventing me from linking to any ODBC data source. 

Observations:  This function has worked normally in the recent past and works on other computers running Access 2003.  One difference between the computers working and non-working computers is Norton Antivirus 2006 (recent upgrade).

Has anyone experienced anything like this?  What's going on?

View 8 Replies View Related

Excel 2003 To SQL Server 2005 OLAP Cube Timeout Issues

Nov 13, 2007


Hola

We are getting symptoms of a 30 second timeout irrespective of what we do, but only on certain machines. Can anyone shed any light on how the connection timeout can be set, as there seems to be a factor overiding any settings we set?

We are working in Excel (2003) connecting to an Analysis Services 2005 cube through a website https://Datasource connection. When we edit the connection string that the file is using (either by forcing use of an exterior .ODC file and editing the settings in there, or by converting the xls spreadsheet into an xml spreadsheet and manually editing the connection string in there) we get no joy: after 30 seconds the error appears:


"Either a connection cannot be made to the [my server address], or Analysis services is not running on the computer specified".

This error is itself rubbish: If a smaller query (one that takes < 30 seconds) is run in the same Excel file and Pivot Table, it connects fine.
What really doesn't make sense is that the exact same file works on some machines and not others. These machines are all inside the same network (and the machines that work have been proven to work on a number of other networks). What's more there is no pattern to the machine capabilities - some newer / faster machines get the error. These machines (that work and do not) have excel 2003 SP3. (Another of the ones that works has Excel 2007).

Changing the connection string to include "Timeout=300" or "Connect Timeout=300" makes no difference, and "Command Timeout" causes a different error so that it wont even attempt to run the query (as opposed to collapsing after 30 seconds of normal progress).
Similarly in the .ODV the tags <ODC:CommandTimeout>, <CommandTimeout>, <ODC:Connect Timeout>, <ODC:Command Timeout>, <meta name=CommandTimeout content=1000> etc. have no effect (the file still gets the 30 seconds error rather than just giving up so no way of working out correct syntax)

The only pattern we can see, and we can't fix this, is that the machines that work have Retail versions of excel, and the ones that do not have corporately licensed versions of excel. We cannot see any difference between them in the Help >Abouts, but thought it might be worth mentioning.

Any help would be fantastically appreciated, we are out of ideas.
Thanks kindly

Amundo

View 2 Replies View Related

Error Trying To Import MS Access 2003 Database Via SQL Server Import And Export Wizard - Too Many Sessions Already Active

Nov 29, 2006

I am trying to simplify a query given to me by one of my collegues written using the query designer of Access. Looking at the query there seem to be some syntax differences, so to see if this was the case I thought I would import the database to my SQL Server Developer edition.

I tried to start the wizard from within SQL Server Management Studio Express as shown in one of the articles on MSDN which did not work, but the manual method also suggested did work.

Trouble is that it gets most of the way through the import until it spews forth the following error messages:

- Prepare for Execute (Error)
Messages
Error 0xc0202009: {332B4EB1-AF51-4FFF-A3C9-3AEE594FCB11}: An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Could not start session. Too many sessions already active.".
(SQL Server Import and Export Wizard)

Error 0xc020801c: Data Flow Task: The AcquireConnection method call to the connection manager "SourceConnectionOLEDB" failed with error code 0xC0202009.
(SQL Server Import and Export Wizard)

Error 0xc004701a: Data Flow Task: component "Source 33 - ATable" (2065) failed the pre-execute phase and returned error code 0xC020801C.
(SQL Server Import and Export Wizard).

There does not seem to be any method of specifying a number of sessions, so I don't see how to get round the problem.

Does anyone know how I can get the import to work?

View 2 Replies View Related

How To Import Data From Excel To Sql Server 2005

Apr 3, 2008

hi all,
        how to import data from excel to sql server 2005 using asp.net 2.0 and c#
 
 Ashok

View 3 Replies View Related

How Can I Import Data From Excel To SQL Server 2005 Express

Nov 29, 2007

I would like to import an Excel file into my SQL Server 2005 Express db. I'm using SQL Server Management Studio Express to manage my db.
I appreciate your suggestions,

View 3 Replies View Related

How To Import MS Excel Data Into SQL Server 2005 Express Ed.

Mar 22, 2006

I am using SQL Server 2005 Express Edition for testing and developping my website. How can i import MS Excel Data into a SQL Server table?

View 2 Replies View Related

Import Data From Excel File Into Sql Server 2005?

Feb 22, 2007

Hi all,

I try to import data from excel file, my excel file have column called Name, the value of this column is text: ex: Binh Chanh, 1,2,3,4,5.....When i import into sqlserver 2005, these rows which have value 1,2,3,4,5 (number) , now have Null value in SQL server 2005.

How can i fix this error?

Thanks,

View 1 Replies View Related

Help Setting Up An ODBC Link To SQL Server From Access 2003

May 6, 2007

PLEASE HELP ME



I'm a pretty smart guy, but sometimes I end up feeling left behind with all of the terminology I don't recognize.



I am running XP Pro, Access 2003, and SQL Server 2005 express.

I want to set up a ODBC connection in Access to a table that has been created in an SQL Server 2005 Express Database.



I keep getting the message connection failed, SQL Server does not exist or access denied.



Can somebody here please help me?

View 1 Replies View Related

Formatting Numbers In A Mixed Column (numbers In Some Cells Strings In Other Cells) In Excel As Numbers

Feb 1, 2007

I have a report with a column which contains either a string such as "N/A" or a number such as 12. A user exports the report to Excel. In Excel the numbers are formatted as text.

I already tried to set the value as CDbl which returns error for the cells containing a string.

The requirement is to export the column to Excel with the numbers formatted as numbers and the strings such as "N/A' in the same column as string.

Any suggestions?



View 1 Replies View Related

Import Excel File Into Dropdownlist Then Export To Sql Server 2005

Jun 13, 2006

i am handling a project where user can choose the excel file and the field in the excel file to export into sql server 2005. which mean there will be dropdownlist where the user can choose the field and so on. anyone know how to do this?

View 2 Replies View Related

SQL Server 2008 :: Updating Server Table From Excel Cells?

Jul 3, 2015

I have an sql server table which serves as a criteria table for my sql server query.

i wish to update the sql server table from the excel worksheet. The intention is to allow the end user to change the values in a specific column in the sql server table via excel.

The table in question has the following fields

SELECT
[Cluster]
,[Max_Break_btw]
,[RefD_Max_Break]
,[DischD_Max_Break]
,[MaxReviewPeriods]
FROM [databseName].[dbo].[SpellClusterAssum]

I will like to change / update the values in the "[Max_Break_btw]" column.

View 0 Replies View Related

How To Use SQL Svr 2005 Express In Excel 2003 VBA Code?

Jun 23, 2006

Hello,

how can I use SQL Svr 2005 Express as database engine in background through VBA code in Excel 2003?

I want to CREATE and DELETE tables and SELECT, INSERT and UPDATE data. Is it possible to use ADO or other database objects to get in contact with SQL Svr 2005 Express?

Thanks a lot.

Christian

View 4 Replies View Related

How To Sum The Cells In Excel Using Asp

Jun 28, 2005

Hi

i need to sum the values in different cells of an excel sheet which im getting from data base and which is in a loop and the number of entries depends on the user.Please help me out

im adding the code please check it out:


<%
Response.ContentType = "application/vnd.ms-excel"
%>



<html>

<body>

<%

dim objConn
set objConn=server.CreateObject("ADODB.Connection")
objConn.open "provider=SQLOLEDB;data source=10.100.17.107;initial catalog=RUT;user id=test;password=test;"

iMonth = Request.QueryString ("month")
iyear = Request.QueryString ("year")
intpid = Request.QueryString ("project")
inteid = Request.QueryString ("eid")



dim fDate
DIM fmonth
Dim fi

if iMonth = "February" and iYear mod 4 <> 0 then
iTo = 28
elseif iMonth = "February" and iYear mod 4 = 0 then
iTo = 29
end if

if (iMonth = "April" or iMonth = "June" or iMonth = "September" or iMonth = "November") then iTo = 30 end if

if (iMonth = "January" or iMonth = "March" or iMonth = "May" or iMonth = "July" or iMonth = "August" or iMonth = "October" or iMonth = "December") then iTo = 31 end if

dim rsobj1,rsobj2,rsobj5,rsobj9

sql1 = "select first_name from tblUserMaster where emp_id='"&inteid&"'"
set rsobj1 = objConn.Execute (sql1)

sql2 = "select distinct activity_id from tblTimeSheet where month='"&iMonth&"' and year='"&iyear&"' and project_id='"&intpid&"' and emp_id='"&inteid&"' and bill_non = ''"
set rsobj2 = objConn.Execute (sql2)
%>


<b>Employee Name:<%=rsobj1("first_name")%></b>


<TABLE BORDER=1>
<TR>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></td>
<TD ><%=imonth%></TD>
<TD ></td>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>

<TD ><%=imonth%>

</TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ><%=imonth%></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ><%=imonth%></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>
<TD ></TD>

</TR>

<TR bgcolor="#ffffff" style="FONT-FAMILY: fantasy; BACKGROUND-COLOR: powderblue">

<td ><b>Client/Assignment</b> </td>
<td ><b>ProjectName</b> </td>
<td ><b>Remarks</b></td>
<td><b>Total Hrs</b></td>

<%for i = 1 to iTo



fmonth=imonth
fi =i

fDate = fi & "/" & fMonth & "/" & iYear




Response.Write "<td align=center><b>" & i & "</p>" & weekdayname(weekday(fdate)) & "</b></td>"


next%>
</TR>


<%'===============================================d efault activity============================%>

<% do until rsobj2.EOF%>
<tr>
<%
dim intactid,rsobj3
intactid = rsobj2("activity_id")




sql3 = "select activity_name from tblActivityMaster where activity_id = '"&intactid&"'"
set rsobj3 = objConn.Execute (sql3)

sql4 = "select no_of_hrs,remarks,date from tblTimeSheet where month='"&iMonth&"' and year='"&iyear&"' and project_id='"&intpid&"' and emp_id='"&inteid&"' and activity_id='"&intactid&"'"
set rsobj4 = objConn.Execute (sql4)

%>

<td><%=rsobj3("activity_name")%></td>
<td></td>
<td><%=rsobj4("remarks")%></td>
<td></td>
<%do until rsobj4.eof%>

<%if (rsobj4("no_of_hrs") < 8 ) then%>
<td><%=rsobj4("no_of_hrs")%></td>// I need to add the values i get in this td and display in the td with red colour and the number of values may change according to the user
<%else%>
<td>8</td>
<%end if%>



<%
rsobj4.movenext
loop
%>



</tr>
<%
rsobj2.movenext
loop

%>



Thanks


ajith

View 1 Replies View Related

Value Of Cells (Like Excel)

Jul 26, 2007



Hi all,
I would to take a value of a cells in my matrix to load an other. Like we usually do in Excel
A2 = A1 * 100 for Example...
An idea ?

Regards,
Erwan, France

View 3 Replies View Related

SQL Server 2012 :: Unable To Link Data After Import From XML Into Tables

Aug 13, 2015

I'm pulling data from XML into tables, but I'm unsure how to link the data after it's imported. This example has names and tasks, and I can pull the data into two tables, but I can't find any way to link the task to the appropriate person. My person and task tables populate without issue, but there's nothing I can find to link the rows together. So in this example Test 1 would go to the first two Tasks and Test 2 would go to the second two work items.

DECLARE @XML TABLE (XMLData XML);
DECLARE @Person Table (Name NVARCHAR(50), Addresss NVARCHAR(50));
DECLARE @Task Table (Name NVARCHAR(50), Details NVARCHAR(50));
INSERT INTO @XML SELECT '
<process>
<header>
<Person><Name>Test1</Name><Address>123 main street</Address></Person>

[Code] .....

View 9 Replies View Related

Cannot Import/link Data From DBase With SQL Server DTS Nor Access Anymore..

Jul 20, 2005

Hi,SQL Server 2000 SP3Windos 2000 Server SP4I have a DTS package that imports data from a dBase IV databse withfiles located in two folders (dBF1 and dBF2). I use a transform datatask to transform the data.They were running properly, but last week we installed W2K SP4, andnow the transform task for files from dBF2 are not working properly.I have two tranform tasks to extract data from files in dBF2 folder.If I double click to open the transform data task of either of them,Enterprise Manager crashes with the errrormmc.exe applicatio ErrorThe instruction "xxxx" referenced memory at "xxx". The memory couldnot be read.Althoug the transform task for one of the files will run, the otherwill not run giving the messageError Source: DTS packageCatastrophic failureAlso, I have an Access database that has links to the same dBasefiles. For files from dBF2 folder, I'm able to see the data from oneof the files, but if I double click to see the data from the other,access crashes with no specific error message. Nothing has changed ondBase related files (permission wise).The transform tasks to extract data from the other dBase folder (dBF1)files are working fine, and data is accesible from Access.Any advice how to tackle this one?

View 2 Replies View Related

Import Specific XLS Cells From Dynamic Filename

Oct 26, 2005

Hi
I'm struglling with this, can anyone assist. I'd go as far as to say, there is $$ up for the solution that works.

Here's the routine..

1) Upload file to server - works, no problem.

2) Extract cell ref A1-ws1 & A1-ws2 from the newly uploaded file (myXLSFileName - WHERE ProjectID = Session("strProjectID").

3) Update tMyTable.myfield1 with A1-ws1 & tMyTable.myfield2 with A1-ws2 WHERE ProjectID = Session("ProjectID")

All efforts greatly received!.
Thanks

View 2 Replies View Related

Excel Merged Cells

May 15, 2007

Hi



I'm trying to eliminate merged cells when exporting a report to Excel. My problem being my report textbox above my table.



I've searched and found that making the textbox the same width as the first column eliminates the merging. Perfect, it does. But when the report is viewed in the report viewer, the textbox can only expand vertically. So the title looks terrible because column one is not wide.

I've read that expand horizontally is not an option
I don't seem to be able to tell it not to output that text box, which would be an option if there is no other answer
I can't have the text box the size I want it, due it creating merged cells
I don't want to export it as a CSV

Are there any other options available or am missing something?



Cheers

View 5 Replies View Related

Getting Comment In Excel Cells

Apr 7, 2006

Hi,

Can any tell me how to check whether any Comment been entered in a Cell in the Excel Sheet?

It is pretty urgent. Solutions are greatly appreciable.

Thanks & Regards,

Prakash Srinivasan.

View 2 Replies View Related

Not Able To Import Excel, MDB To SQL 2005

Nov 16, 2007

I need to create an application to import several text, excel and mdb files into SQL2005. I created a c# application to dynamically create a package & import text files but not able to do the same with excel and mdb files.
I guess i am not giving the right connections. Any help on this please........

//Create connections

//Source Connection

IDTSComponentMetaData90 ExcelSource;

IDTSComponentMetaData90 oledbDestination;

MainPipe dataFlow;

//Add connections

ConnectionManager conMgr = pkg2.Connections.Add("OLEDB");

ConnectionManager EconMgr = pkg2.Connections.Add("EXCEL");

/// Set stock properties

conMgr.Name = "OLEDBConnection";

conMgr.ConnectionString = ConnString;//



//Set stock properties

EconMgr.Name = "ExcelConnection";

EconMgr.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + InputfileLoc +

";Extended Properties=Excel 8.0;HDR=YES;";

TaskHost th = pkg2.Executables.Add("DTS.Pipeline") as TaskHost;

th.Name = "DataFlow";

dataFlow = th.InnerObject as MainPipe;

// set source component

ExcelSource = dataFlow.ComponentMetaDataCollection.New();

ExcelSource.ComponentClassID = "DTSAdapter.ExcelSource";

ExcelSource.Name = "ExcelSource";

CManagedComponentWrapper instanceSource = ExcelSource.Instantiate();

ExcelSource.RuntimeConnectionCollection.New();

ExcelSource.RuntimeConnectionCollection[0].ConnectionManagerID = pkg2.Connections["ExcelConnection"].ID;

ExcelSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(pkg2.Connections["ExcelConnection"]);

instanceSource.ProvideComponentProperties();

instanceSource.SetComponentProperty("OpenRowset", "book1");

instanceSource.SetComponentProperty("AccessMode", 0);

// Acquire Connections and reinitialize the component

instanceSource.AcquireConnections(null); -----I am failing here with a com exception
instanceSource.ReinitializeMetaData();

instanceSource.ReleaseConnections();

//set destination component

oledbDestination = dataFlow.ComponentMetaDataCollection[1];

if (oledbDestination.RuntimeConnectionCollection.Count > 0)

{

oledbDestination.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(pkg2.Connections["OLEDBConnection"]);

oledbDestination.RuntimeConnectionCollection[0].ConnectionManagerID = pkg2.Connections["OLEDBConnection"].ID;

}

CManagedComponentWrapper instanceDest = oledbDestination.Instantiate();

instanceDest.SetComponentProperty("OpenRowset", desttable);

instanceDest.SetComponentProperty("AccessMode", 0);

// Acquire Connections and reinitialize the component

instanceDest.AcquireConnections(null);

instanceDest.ReinitializeMetaData();

instanceDest.ReleaseConnections();

IDTSInput90 input = oledbDestination.InputCollection[0];

IDTSVirtualInput90 vInput = input.GetVirtualInput();

foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)

{

IDTSInputColumn90 vCol = instanceDest.SetUsageType(input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READWRITE);

instanceDest.MapInputColumn(input.ID, vCol.ID, input.ExternalMetadataColumnCollection[vColumn.Name].ID);

}

//string currentDirectory = System.IO.Directory.GetCurrentDirectory();

a.SaveToXml(Pacloc, pkg2, null);

View 5 Replies View Related

Shifted Cells In Excel Export

Mar 25, 2008

Hi,

I created a report in list view (I have to use a subreport in it) and when I export it to excel the cells are shifted even in the header. The html is ok - the problem is only with export.

like this:


Title First Name Last Name Address


Mr John Smith Peartree Str.

I tried to fix the size and location on every cells, but this does'n work in export. Some of the cells drop at the next row and some of they are merged. I was able to receive some good export - but only with a lot of attempts of cells resizing.
Is there any way to avoid this shifting?

View 5 Replies View Related

Export To Excel Gives Me Gray Cells

Dec 28, 2006

I have a report which was in RS 2003 and exported to Excel fine. Now when I export the same report using RS 2005 to Excel I get gray cells at the bottom of each table. I have the background of the body set to transparent. I have tried setting the background of the body to white and other colors. Those colors show up but the gray is still there as well. In preview mode and export to pdf I do not have those problems. Basically gray cells are showing up where they should not be. Any help would be great.

View 4 Replies View Related

Import Excel To Sql 2005 - Realtime

Nov 2, 2007

Ther eis an excel file.
This file is open all the time so the excel sheets get populated by an external third party application real time.
So the data inside the spreadsheets are constantly changing. This spreadsheet is only capable of being updated with data when it is open.
And I would like to import this excel data on a certain interval into sql server 2005.
Tried using the import wizard but it seems the import does not work if the source i.e. the excel file is open.
Is there an alternative please?
Thanks

View 1 Replies View Related

Export To Excel - Number Formatted Cells Export To Excel As 'General' ?

Feb 5, 2007

Anyone know why cells within a matrix that are formatted as numeric export to Excel with a cell format proprty of "General"? Cells within a table however export with an appropriate format.

Thanks

View 1 Replies View Related

How To Get Next/previous Cells In Matrix In Excel Style?

Apr 30, 2008

Hi

I have matrix, in data cells I want to perform calculation based on value in this cell and next/previous cell. Something like : "=B3-A3" in MS Excel.

How can I get the value form next/previous cell in matrix?

There is Previous function but it does'nt work in matrix. Are there workarounds?

Andriy Zhornyk

View 2 Replies View Related







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