Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:这句话里面的插入时z2,z3总报错,因为那两列是逻辑型

1楼
dd-zdh 发表于:2011/5/6 15:04:00
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
2楼
lihe60 发表于:2011/5/6 15:10:00
没有附件,只有高手才能帮助的。
3楼
狐狸爸爸 发表于:2011/5/6 15:11:00
cmd.CommandText="insert into 授权表 (部门,用户名,表名,列名,不可见,不可编辑) values ('" & lst1 & "','" & lst2 & "','" & lst3 & "','" & z1 & "'," & z2 & "," & z3  & ")"
4楼
dd-zdh 发表于:2011/5/6 15:24:00
谢谢!变量引用的规则不是很熟
5楼
blackzhu 发表于:2011/5/6 15:27:00
For i=0 To ilst -1  这边的定义是不是少什么了,这样也行的吗?
6楼
狐狸爸爸 发表于:2011/5/6 15:31:00

建议楼主看看:

http://help.foxtable.com/topics/1284.htm

 

共6 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.