asp import excel
Budget: €8 – €30 EUR
ASP Import Excel Project Description
Format of Excel file: .xls
Database for data import: MySQL
Desired outcome after import: ASP classic or PHP 5.4
Skills and experience required for the job:
- Proficiency in ASP classic or PHP 5.4
- Strong knowledge of MySQL database
- Experience with importing data from .xls files
- Familiarity with data analysis and manipulation
- Attention to detail for accurate data import.
scripts asp classic
<%
'Istanza Upload
dim objUpload
set objUpload = server.CreateObject("Dundas.Upload.2")
'upload
objUpload.UseUniqueNames=true
on error resume next
objUpload.Save idir
If Err.Number <> 0 Then
response.redirect ""
Else
i=0
SET FSO = Server.CreateObject("Scripting.FileSystemObject")
For Each objUploadedFile in objUpload.Files
'update file
updnomefile=cstr(objUpload.GetFileName(objUpload.Files(i).Path))
Next
SET FSO = NOTHING
end if
'response.write (idir & updnomefile)
'response.end
fileXLS = (idir & updnomefile)
response.write(mid(updnomefile,1,31))
if instr(updnomefile,"xls")>0 then
Set connexcel = Server.CreateObject("ADODB.Connection")
connexcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & trim(fileXLS) & ";Extended Properties=""Excel 8.0;"""
'Response.Write "Reading file: " & fileXLS & "<br>"
'str = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" & trim(fileXLS) & ";DriverID=790"
'connexcel.Open str
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM [" & cstr(mid(updnomefile,1,33)) & "]"
rs.Open strSQL, connexcel
Response.Write("ciao")
rs.movefirst
Response.Write(strSQL)
Response.Write(str)
'response.end
i=0
Do While not rs.eof
if isnull(rs("0")) then response.write("nullo")
Response.Write("codice :" )
Response.Write("1" & cstr(rs("codice_od")) & "<br>" )
'cstr(rs(3))
Response.Write("2" & rs("codice_buf") & "<br>" )
Response.Write("3" & cstr(rs(5)) & "<br>" )
Response.Write("4" & cstr(rs(6)) & "<br>" )
Response.Write("5" & cstr(rs(7)) & "<br>" )
Response.Write("6" & cstr(rs(7)) & "<br>" )
response.end
i=i+1
'connm.execute ("insert into prodotti_elimina (codice_prodotto,codice_buf,codice_od,descrizione) value ('" & cstr(rs(1)) & "','" & tosql(cstr(rs(2))) & "','" & cstr(rs(3)) & "','" & cstr(rs(4)) & "'," & replace(rs(5),",",".") & "," & replace(rs(5),",",".") & ",'" & cstr(rs(6)) & "'," & cint(rs(7)) & ")")
rs.movenext
Loop
rs.close
set rs = Nothing
connexcel.close
set connexcel = Nothing
'response.end
end if
'response.redirect "admondadorilistaLOAD.asp?insert=ok"
%>
Format of Excel file: .xls
Database for data import: MySQL
Desired outcome after import: ASP classic or PHP 5.4
Skills and experience required for the job:
- Proficiency in ASP classic or PHP 5.4
- Strong knowledge of MySQL database
- Experience with importing data from .xls files
- Familiarity with data analysis and manipulation
- Attention to detail for accurate data import.
scripts asp classic
<%
'Istanza Upload
dim objUpload
set objUpload = server.CreateObject("Dundas.Upload.2")
'upload
objUpload.UseUniqueNames=true
on error resume next
objUpload.Save idir
If Err.Number <> 0 Then
response.redirect ""
Else
i=0
SET FSO = Server.CreateObject("Scripting.FileSystemObject")
For Each objUploadedFile in objUpload.Files
'update file
updnomefile=cstr(objUpload.GetFileName(objUpload.Files(i).Path))
Next
SET FSO = NOTHING
end if
'response.write (idir & updnomefile)
'response.end
fileXLS = (idir & updnomefile)
response.write(mid(updnomefile,1,31))
if instr(updnomefile,"xls")>0 then
Set connexcel = Server.CreateObject("ADODB.Connection")
connexcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & trim(fileXLS) & ";Extended Properties=""Excel 8.0;"""
'Response.Write "Reading file: " & fileXLS & "<br>"
'str = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" & trim(fileXLS) & ";DriverID=790"
'connexcel.Open str
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM [" & cstr(mid(updnomefile,1,33)) & "]"
rs.Open strSQL, connexcel
Response.Write("ciao")
rs.movefirst
Response.Write(strSQL)
Response.Write(str)
'response.end
i=0
Do While not rs.eof
if isnull(rs("0")) then response.write("nullo")
Response.Write("codice :" )
Response.Write("1" & cstr(rs("codice_od")) & "<br>" )
'cstr(rs(3))
Response.Write("2" & rs("codice_buf") & "<br>" )
Response.Write("3" & cstr(rs(5)) & "<br>" )
Response.Write("4" & cstr(rs(6)) & "<br>" )
Response.Write("5" & cstr(rs(7)) & "<br>" )
Response.Write("6" & cstr(rs(7)) & "<br>" )
response.end
i=i+1
'connm.execute ("insert into prodotti_elimina (codice_prodotto,codice_buf,codice_od,descrizione) value ('" & cstr(rs(1)) & "','" & tosql(cstr(rs(2))) & "','" & cstr(rs(3)) & "','" & cstr(rs(4)) & "'," & replace(rs(5),",",".") & "," & replace(rs(5),",",".") & ",'" & cstr(rs(6)) & "'," & cint(rs(7)) & ")")
rs.movenext
Loop
rs.close
set rs = Nothing
connexcel.close
set connexcel = Nothing
'response.end
end if
'response.redirect "admondadorilistaLOAD.asp?insert=ok"
%>