PDA

View Full Version : how to edit recordset through ADO



helai
03-09-2006, 08:35 PM
now i can export data to excel through ado technical,just like below

part = "555"
cnt.Open "dsn=ccc", "123", "123"
STRSQL1 = "SELECT PST_CompItemID "
STRSQL2 = "FROM dbo.PST PST "
STRSQL3 = "WHERE PST_CompItemID = '" & part & "'"
rststring = STRSQL1 & STRSQL2 & STRSQL3
rst.Open rststring, cnt

but now actually i want to set
rst.Fields("PST_RoutSeqID").Value = "35036"
if the part 555 is found in this sheet,

but for me is difficult to write code to execute this action,who can help me to solve it
the function is

open the dbo pst pst and if pst_compitemid equal "555" then set pst_routseqid =35036

any suggestion is appreciated

helai

Bob Phillips
03-10-2006, 03:45 AM
Are you wanting to write that value back to the data source, or just amend it for later use in your code?