Using ADO, all the records update instead of just 1. What am i doing wrong?
am 24.09.2007 04:39:46 von MikeHeres the code, I am doing it with excel. I dont normally use
recordsets and I don't understand why all the records are updating at
once. Any ideas?
Set cnnExcel = Server.CreateObject("ADODB.Connection")
'known as a DSN-less connection
cnnExcel.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ=" &
Server.MapPath("calc4.xls") & ";ReadOnly=0;"
Set rstExcel = Server.CreateObject("ADODB.Recordset")
'http://www.w3schools.com/ado/prop_rs_cursortype.asp
'http://www.w3schools.com/ado/prop_rs_locktype.asp
rstExcel.Open "SELECT * FROM TestData WHERE id=1;", cnnExcel, 3, 3
rstExcel.MoveFirst
rstExcel("symbol") = myStock1.symbol
rstExcel("historical_price")= myStock1.historical_price
rstExcel("opening_price") = myStock1.opening_price
rstExcel("pe_ratio")= myStock1.pe_ratio
rstExcel("market_cap")= myStock1.market_cap
rstExcel.Update