To be precise, the error is as follows:
Active Server Pages error 'ASP 0115'
Unexpected error
A trappable error (E06D7363) occurred in an external object. The script can not continue running.
Here is the script :
Code:
<%
Dim con, fs, objfile, objFileTextStream, i, strSQL, file
Dim strLine, strLine1, strValue1, strValue2, strValue3, strValue4, strValue5, strValue6, strValue7
September fs = Server.CreateObject ("Scripting.FileSystemObject")
file = Server.MapPath ("/ public / myfile.txt")
September objfile fs.GetFile = (file)
September objFileTextStream objFile.OpenAsTextStream = (1)
Do While objFileTextStream.AtEndOfStream <> True
strLine = objFileTextStream.ReadLine
strLine1 = split (strLine ,"|")
for i = 0 To UBound (strLine1)
If i = 0 Then
strValue1 = Trim (strLine1 (i))
ElseIf i = 1 Then
strValue2 = Trim (strLine1 (i))
ElseIf i = 2 Then
strValue3 = Trim (strLine1 (i))
ElseIf i = 3 Then
strValue4 = Trim (strLine1 (i))
ElseIf i = 4 Then
strValue5 = Trim (strLine1 (i))
ElseIf i = 5 then
strValue6 = Trim (strLine1 (i))
ElseIf i = 6 then
strValue7 = Trim (strLine1 (i))
End If
Next
strSQL = "INSERT INTO table (value1, value2, value3, value3, value4, Value5, Value6, Value7) Values ('" & strValue1 & "', '" & strValue2 & "', '" & strValue3 & "', '" & strValue4 &"',' "& strValue5 &"','"& strValue6 &"','"& strValue7 &" '"
con.Execute strSQL
Loop
objFileTextStream.Close
September objFileTextStream = Nothing
September fs = Nothing
%>
Bookmarks