VBScript

Could someone please tell me why this bit of code keeps giving me the error:

"Subscript out of range"

If CharCurrentVal = TextDelimiter Then
counter = + 1
tempArray(counter) = tempString
tempString = ""
Else
tempString = tempString & CharCurrentVal
End If

next

'if vType = "position" then

'-----------------------------------------------------------------------------------------------------------------------

Set dbConn= Server.CreateObject("ADODB.Connection")

' Modify the following line accordingly if you change the database file name
' or decide to use a DSN connection.

dbConn.Open "DBQ=" & Server.Mappath("aaa.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

Set dbRecSet = Server.CreateObject("ADODB.Recordset")
dbRecSet.Open "Position_Probe",dbConn,2,3

dbRecSet.MoveFirst

'Loop through column

'For counter = 1 to NoItems
' Next
dbRecSet("item1") = tempArray(1)


I am trying to get a program to fill in fields on a database, one of the fields is headed "item1"

I think that the problem is within this part of the code.

Thanks

 

 

 

 

Top