<%
server.scripttimeout=900
const adCmdText=&H0001:const adExecuteNoRecords=&H00000080:const adGetRowsRest=-1:const adOpenForwardOnly=0:const adLockReadOnly=1
dim arrRecords,intRecords,objConn,objRs
set objConn=server.createobject("ADODB.Connection")
objConn.open "provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;data source="&server.mappath("excel.xls")
set objRs=server.createobject("ADODB.Recordset")
objRs.open "SELECT * FROM FirstField:LastField",objConn,adOpenForwardOnly,adLockReadOnly,adCmdText
intRecords=-1
if not objRs.eof then
arrRecords=objRs.getrows(adGetRowsRest)
intRecords=ubound(arrRecords,2)
end if
objRs.close:set objRs=nothing
objConn.close
set objConn=server.createobject("ADODB.Connection")
objConn.open "driver={MySQL ODBC 3.51 Driver};server=IP;uid=user;pwd=pass;database=db"
if intRecords>-1 then
for x=0 to intRecords
' some string manipulation, combining fields, etc.
objConn.execute("INSERT INTO TABLE (FIELDS) VALUES (VALUES)"),,adCmdText+adExecuteNoRecord
response.write "INSERT INTO TABLE (FIELDS) VALUES (VALUES)<br />"
next
end if
objConn.close:set objConn=nothing
%>