Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS Script, Array problem

Status
Not open for further replies.

nollieflip

Programmer
Aug 22, 2003
5
US
I am writing a script that is getting used a DTS package for SQL server 2000. The VBScript parser is hanging on the following snippet, specifically the first line. Parsing error, expected ')'. Anyone have any ideas? Maybe my syntax is way off, I'm a bit rusty...

Dim aryPCOLevel(0 To 2) As Integer

aryPCOLevel(0) = "DTSSource("Field1")"
aryPCOLevel(1) = "DTSSource("Field2")"
aryPCOLevel(2) = "DTSSource("Field3")"

intHigh = aryPCOLevel(0)
For i = 2 To UBound(aryPCOLevel)
If aryPCOLevel(i) > intHigh Then
intHigh = aryPCOLevel(i)
End If
End Sub

DTSDestination("CFPSomeField") = intHigh
 
try this for your first line
Dim aryPCOLevel(2)

Leave off the "0 to" and "as integer"
 
In VBScript you can't use typed variable as in VBA or VB.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top