我的程序代码:
Private Sub Command1_Click()
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
cnn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\shi\shi\5.19\毕业论文(设计)资料\PinZhong.mdb;Persist Security Info=False")
cnn.Execute ("alter table new13 add column 适合肥力密度 text")
If turangzixun.feili = 低肥力 Then
cnn.Execute ("select 适宜密度*1.15 as 适合肥力密度 from new13") 这里有问题吗?
ElseIf turangzixun.feili = 中等肥力 Then
cnn.Execute ("select 适宜密度*1 as 适合肥力密度 from new13")
ElseIf turangzixun.feili = 高肥力 Then
cnn.Execute ("select 适宜密度*0.9 as 适合肥力密度 from new13")
End If
用Update语句吧
Update new13 set 适宜密度= 适宜密度 * 1.15