I need a coder
Budget: $250 – $750 USD
I have a client that has an existing program for data entry. The program takes the customer data that she enters and compresses the data into 3 .txt files and uploads the 3 files to the root directory of her website. Once those are uploaded, she has a .asp web page that has a script that she executed which takes the data from the .txt files and transfers it to the sql databases. At the present time, the process has stopped functioning as it should and the data is being deleted but not replaced as the code is written to do. I have pasted the info from the .asp web file below. This will be more of a troubleshooting project and maybe some evaluation of the current databases to see why it has stopped functioning.
<%
response.Buffer = false
server.ScriptTimeout = 1200
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8 %>
<% 'Open and read a text file.
On error resume next
Set OBJdbConnectionMem = Server.CreateObject("ADODB.Connection")
OBJdbConnectionMem.Open "DRIVER=MySQL ODBC 3.51 Driver;SERVER=localhost;DATABASE=p26330_PNI;UID=p2633_pni;PASSWORD=“password removed”;OPTION=3"
tmpOut = ""
Filename = "/webdata1.txt"
Dim Filepath
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM ntodata1;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """]"
tmpOut = replace(tmpOut, """, "" ""]", """)")
'response.Write tmpOut
SQLStrMem = "INSERT INTO ntodata1 VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "1/3 Loaded...
"
Filename = "/webdata2.txt"
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM mem;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """]"
tmpOut = replace(tmpOut, """, "" ""]", ""","""","""","""")")
'response.Write tmpOut
SQLStrMem = "INSERT INTO mem VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "2/3 Loaded...
"
Filename = "/webdata3.txt"
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM reqdata1;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """)"
'tmpOut = replace(tmpOut, """, "" ""]", """)")
'response.Write tmpOut
SQLStrMem = "INSERT INTO reqdata1 VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "3/3 Loaded...
"
%>
Done
<%
response.Buffer = false
server.ScriptTimeout = 1200
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8 %>
<% 'Open and read a text file.
On error resume next
Set OBJdbConnectionMem = Server.CreateObject("ADODB.Connection")
OBJdbConnectionMem.Open "DRIVER=MySQL ODBC 3.51 Driver;SERVER=localhost;DATABASE=p26330_PNI;UID=p2633_pni;PASSWORD=“password removed”;OPTION=3"
tmpOut = ""
Filename = "/webdata1.txt"
Dim Filepath
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM ntodata1;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """]"
tmpOut = replace(tmpOut, """, "" ""]", """)")
'response.Write tmpOut
SQLStrMem = "INSERT INTO ntodata1 VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "1/3 Loaded...
"
Filename = "/webdata2.txt"
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM mem;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """]"
tmpOut = replace(tmpOut, """, "" ""]", ""","""","""","""")")
'response.Write tmpOut
SQLStrMem = "INSERT INTO mem VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "2/3 Loaded...
"
Filename = "/webdata3.txt"
Filepath = Server.MapPath(Filename)
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(Filepath, ForReading)
SQLStrMem = "DELETE FROM reqdata1;"
OBJdbConnectionMem.Execute( SQLStrMem )
do while not file.AtEndOfStream
tmpOut = "("""
tmpOut = tmpOut & Replace(Replace(file.ReadLine, chr(34), "'"), vbTab, """, """)
tmpOut = tmpOut & """)"
'tmpOut = replace(tmpOut, """, "" ""]", """)")
'response.Write tmpOut
SQLStrMem = "INSERT INTO reqdata1 VALUES " & tmpOut & ";"
OBJdbConnectionMem.Execute( SQLStrMem )
loop
file.Close()
response.write "3/3 Loaded...
"
%>
Done