Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS VBA Error

Author  Topic 

swain69
Starting Member

3 Posts

Posted - 2008-09-24 : 19:13:29
Hi,

I'm using the DTS Import/Export Wizard to import a text file into a SQL Server and saving the DTS package as a Visual Basic File (to automate a batch of imports). When running this bas file on a tab delimiter file I'm getting an error message "Column Name 'Blah Blah' not found". This works perfectly on comma delimiter file though. I'm guessing there is an error in the default template connection properties of the package.
PS: I cannot change the source to be comma delimiter, its set in stone.


Any help would be appreciated.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-26 : 04:09:38
Show us the script.
Maybe you could change the delimiter to "\t" for TAB character?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

swain69
Starting Member

3 Posts

Posted - 2008-09-28 : 18:15:19

Hi,
Thanks for your response. "/t" has the same error message.

Set oConnection = goPackage.Connections.New("DTSFlatFile")

oConnection.ConnectionProperties("Data Source") = "J:\AdHocRequests\Pharm\Metro\Data\Combined.txt"
oConnection.ConnectionProperties("Mode") = 1
oConnection.ConnectionProperties("Row Delimiter") = vbCrLf
oConnection.ConnectionProperties("File Format") = 1
oConnection.ConnectionProperties("Column Delimiter") = " "
oConnection.ConnectionProperties("File Type") = 1
oConnection.ConnectionProperties("Skip Rows") = 0
oConnection.ConnectionProperties("Text Qualifier") = """"
oConnection.ConnectionProperties("First Row Column Name") = True
oConnection.ConnectionProperties("Max characters per delimited column") = 8000
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-29 : 01:54:12
oConnection.ConnectionProperties("Column Delimiter") = vbTab




E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

swain69
Starting Member

3 Posts

Posted - 2008-10-01 : 19:35:09

Thanks, that did it !
Go to Top of Page
   

- Advertisement -