dbTalk Databases Forums  

File path in Global Variable

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss File path in Global Variable in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Trond Hindenes
 
Posts: n/a

Default File path in Global Variable - 07-15-2004 , 07:03 PM






Hi,
I am having a problem here, since i am quite new to DTS programming.

I have made a DTS package (stored in SQL Server, but that shouldn't
matter) that basically takes an Excel file and impoprts the contents
into a SQL Server. The location of the Excel file will vary, and I
will eventually use vb.net to pass a Global Variable that will hold
the path to the excel file.

In DTS Designer, I have successfully created the package, along with
the "Dynamic Properties" task that sets the "DataSource" variable of
"Connection 1" to the value of my Global Variable "SourceFile". The
strange thing is, this keeps failing when I pass a string e.g.
"C:\testfile.xls" to that global variable. I monitor file access
using filemon, and it turns out that DTS tranlates my file location to

C:\Program Files\Microsoft SQL Server\80\Tools\BINN\"c:\testfile.xls"

Which makes no sense. After a bit of trying, I can specify a string
like

\test.xls

to make DTS open my file at c:\test.xls. But how am I supposed to
specify a file located at another drive than my SQL Server BINN
folder???

Hopefully I've overlooked something, and you guys laugh at me while
pointing me in the right direction :-)

Best regards,
Trond Hindenes

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: File path in Global Variable - 07-16-2004 , 01:06 AM






In article <c175a21a.0407151603.34fbc6cb (AT) posting (DOT) google.com>, Trond
Hindenes wrote:
Quote:
Hi,
I am having a problem here, since i am quite new to DTS programming.

I have made a DTS package (stored in SQL Server, but that shouldn't
matter) that basically takes an Excel file and impoprts the contents
into a SQL Server. The location of the Excel file will vary, and I
will eventually use vb.net to pass a Global Variable that will hold
the path to the excel file.

In DTS Designer, I have successfully created the package, along with
the "Dynamic Properties" task that sets the "DataSource" variable of
"Connection 1" to the value of my Global Variable "SourceFile". The
strange thing is, this keeps failing when I pass a string e.g.
"C:\testfile.xls" to that global variable. I monitor file access
using filemon, and it turns out that DTS tranlates my file location to

C:\Program Files\Microsoft SQL Server\80\Tools\BINN\"c:\testfile.xls"

Which makes no sense. After a bit of trying, I can specify a string
like

\test.xls

to make DTS open my file at c:\test.xls. But how am I supposed to
specify a file located at another drive than my SQL Server BINN
folder???

Hopefully I've overlooked something, and you guys laugh at me while
pointing me in the right direction :-)

Best regards,
Trond Hindenes

Not seen this one before I have to say.

What SP are you running?


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
www.konesans.com - for all your consultancy needs





Reply With Quote
  #3  
Old   
Trond Hindenes
 
Posts: n/a

Default Re: File path in Global Variable - 07-16-2004 , 03:04 AM





I am running SQL Server Personal Edtn SP3 (build 8.00.760) on a Windows
XP box with SP1. My SourceFile variable uses a string datatype. Maybe I
would be better off by using a different type?

Best regards
-Trond

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: File path in Global Variable - 07-16-2004 , 03:36 AM



In article <u0yAMuwaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Trond Hindenes wrote:
Quote:
I am running SQL Server Personal Edtn SP3 (build 8.00.760) on a Windows
XP box with SP1. My SourceFile variable uses a string datatype. Maybe I
would be better off by using a different type?

Best regards
-Trond

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

String variable should be OK.

From what are you reading the value for the Global Variable?


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
www.konesans.com - for all your consultancy needs





Reply With Quote
  #5  
Old   
Trond Hindenes
 
Posts: n/a

Default Re: File path in Global Variable - 07-16-2004 , 10:53 AM



Hi,
Thanks for replying.

Eventually, I'll use vb.net to specify the value of the Global
Variable, but I have tried to hard-code it into the DTS package as
well, along with specifying it using "DTSRUN /A".

I guess I could set up another machine and see if that behaves the
same way, since this seems to be a curious problem.

_Trond

Quote:
String variable should be OK.

From what are you reading the value for the Global Variable?


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
www.konesans.com - for all your consultancy needs

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.