hi
i want to insert a data into a SQL Server from Excel file using ASP
plz help me
i want to insert a data into a SQL Server from Excel file using ASP
plz help me
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\myspreadsheet.xls; Extended Properties=Excel 8.0;"
set objRS = server.createObject("ADODB.recordset")
objRS.open objConn, "SELECT * FROM sql1"
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "mySQLtable"
set RS = server.createObject("ADODB.recordset")
RS.open conn, "SELECT * FROM sql1", adOpenDynamic, adLockOptimistic
do until objRS.eof
RS.addnew
for each x in objRS
RS(x) = objRS(x)
next
RS.update
objRS.moveNext
loop
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\myspreadsheet.xls; Extended Properties=Excel 8.0;"
set objRS = server.createObject("ADODB.recordset")
objRS.open objConn, "SELECT * FROM sql1"
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "mySQLtable"
set RS = server.createObject("ADODB.recordset")
RS.open conn, "SELECT * FROM sql1", adOpenDynamic, adLockOptimistic
do until objRS.eof
RS.addnew
for each x in objRS
RS(x) = objRS(x)
next
RS.update
objRS.moveNext
loop
for each x in objRS
response.write "<!-- Adding " & x & " -->" & vbNewLine
RS(x) = objRS(x)
next
Comment