我需要再数据集李建立一个新的列(reduct),然后需要查询另一个列(id)
其中表employee里没有reduct字段。
rptReduct1.Fields.Append "reduct", adInteger, 40, adFldFixed
If rptReduct1.State = adStateOpen Then rptReduct1.Close
rptReduct1.CursorLocation = adUseClient
rptReduct1.Open "select id from employee", dbConnect, adOpenDynamic, adLockOptimistic
接着我需要做一个循环,吧reduct字段的每一个值复成0。
rptReduct1.MoveFirst
For intI = 0 To rptReduct1.RecordCount - 1
* rptReduct1.Fields("reduct") = 0
rptReduct1.MoveNext
Next intI
其中表employee里没有reduct字段。
rptReduct1.Fields.Append "reduct", adInteger, 40, adFldFixed
If rptReduct1.State = adStateOpen Then rptReduct1.Close
rptReduct1.CursorLocation = adUseClient
rptReduct1.Open "select id from employee", dbConnect, adOpenDynamic, adLockOptimistic
接着我需要做一个循环,吧reduct字段的每一个值复成0。
rptReduct1.MoveFirst
For intI = 0 To rptReduct1.RecordCount - 1
* rptReduct1.Fields("reduct") = 0
rptReduct1.MoveNext
Next intI
不需要做循环
set cmd=new adodb.command
cmd.activeconnection=連線名稱
cmd.commandtype=adcmdtext
cmd.commandtext="alter table 表名 add 列名 類型"
cmd.execute