求教vb+accsee
Private Sub Command1_Click()Adodc1.ConnectionString = "provider=Microsoft.jet.OLEDB.4.0;Persist security info= False; Data source=" & App.Path & "\fyxx.mdb"
Adodc1.CursorLocation = adUseClient
= adCmdText
Adodc1.RecordSource = "select * from czfy where 区域 = '" & Combo1.Text & "'"
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sql As String
Dim conn As String
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=fyxx.mdb;Persist Security Info=False"
sql = "select 区域 from qy"
rst.Open sql, con, adOpenKeyset, adLockOptimistic
Combo1.Clear
Do While Not rst.EOF
Combo1.AddItem (Trim(rst(0)))
rst.MoveNext
Loop
rst.Close
con.Close
End Sub
Private Sub MS1_DblClick()
Form3.Show
End Sub
有什么可以优化下的吗?