Dim cmd As New SQLCommand Dim lst1,lst2,lst3,z1 As String Dim i,ilst As Integer Dim z2,z3 As Boolean Dim clst1 As WinForm.CheckedListBox Dim clst2 As WinForm.CheckedListBox clst1=e.Form.Controls("CheckedListBox1") clst2=e.Form.controls("checkedlistbox2") lst1=e.Form.controls("ComboBox1").text lst2=e.Form.controls("ComboBox2").text lst3=e.Form.controls("ComboBox3").text If lst1<>"" And lst2<>"" And lst3<>"" Then ilst=clst1.Items.Count For i=0 To ilst -1 z1=clst1.items(i) If clst1.GetItemChecked(i) Then z2=True End If If cLst2.GetItemChecked(i) Then z3=True End If cmd.C cmd.CommandText="insert into {授权表} (部门,用户名,表名,列名,不可见,不可编辑) values ('" & lst1 & "','" & lst2 & "','" & lst3 & "','" & z1 & "',z2,z3) " cmd.ExecuteNonQuery Next Else MessageBox.Show("数据不能为空!", "提示") End If
|