VB编程求解
1.(界面里有CommonDialog1跟adodc控件)DataCombo1(标签“性别”右边的框框)为啥没有下拉选项?怎么设置?下面是部分代码:PrivateSubC...
1.(界面里有CommonDialog1跟adodc控件)
DataCombo1(标签“性别”右边的框框)为啥没有下拉选项?怎么设置?
下面是部分代码:
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from zg where 编号=" & Trim(Text1.Text) & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "输入的记录已存在"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) =Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = DataCombo1.Text
Adodc1.Recordset.Fields(3) = Combo1.Text
Adodc1.Recordset.Fields(4) = Combo2.Text
Adodc1.Recordset.Fields(5) = Combo3.Text
If cdg.FileName = "" Then
Adodc1.Recordset.Fields(6) = cdg.FileName
End If
Adodc1.Recordset.Update
MsgBox "增加记录成功"
Adodc1.RecordSource = "select * from zg"
Adodc1.Refresh
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString ="Provider=MSDASQL.1;Persist Security Info=False;Data Source=110"
Adodc1.RecordSource = "select * from zg"
Set DataGrid1.DataSource = Adodc1
End Sub
界面里没有CommonDialog1跟adodc控件 展开
DataCombo1(标签“性别”右边的框框)为啥没有下拉选项?怎么设置?
下面是部分代码:
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from zg where 编号=" & Trim(Text1.Text) & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "输入的记录已存在"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) =Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = DataCombo1.Text
Adodc1.Recordset.Fields(3) = Combo1.Text
Adodc1.Recordset.Fields(4) = Combo2.Text
Adodc1.Recordset.Fields(5) = Combo3.Text
If cdg.FileName = "" Then
Adodc1.Recordset.Fields(6) = cdg.FileName
End If
Adodc1.Recordset.Update
MsgBox "增加记录成功"
Adodc1.RecordSource = "select * from zg"
Adodc1.Refresh
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString ="Provider=MSDASQL.1;Persist Security Info=False;Data Source=110"
Adodc1.RecordSource = "select * from zg"
Set DataGrid1.DataSource = Adodc1
End Sub
界面里没有CommonDialog1跟adodc控件 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询