易截截图软件、单文件、免安装、纯绿色、仅160KB

vb ado控件查询问题

Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in('" & List1.List(List1.ListIndex) & "')"
这句代码怎么错了啊 我想实现查询名字在listbox内的所有人员信息
VB code:

Dim i As Integer
Dim strNames As String

strNames = ""

For i = 1 To List1.ListCount
strNames = ",'" & List1.Text & "'"
Next i
strNames = Right(strNames, Len(strNames) - 1)
If Len(strNames) = 0 Then
Exit Sub
End If

Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in(" & strNames & ")"



in()括号内的各元素要用逗号隔开

VB code:
Private Sub Command1_Click()
Dim i As Long, strTmp As String

For i = 0 To List1.ListCount-1
strTmp = IIf(strTmp = "", "'" & List1.List(i) & "'", strTmp & ",'" & List1.List(i) & "'")
Next i

Adodc2.RecordSource = "select * from 毕业证信息表 where 姓名 in(" & strTmp & ")"
End Sub



相关问答:

关于ASP.net(vb)播放监控录像的问题

我有厂家做的ASP的监控录像(DVR)的局域网播放的源程序与控件,想要用ASP.net做一个视频回放的程序(利用他的控件)但不知如下去做,望各位指点。
先搞清楚他们的控件是怎么用的,
然后就直接用好了.
不过,如 ......

vb打印问题

大家好,问个vb打印问题


printer.print "dsff"
.....
....


Printer.EndDoc


打印成功后我将执行

sqlstr = "update vc_yh set pr=' 已打印 ', ......

VB 字符问题

  TF1.text = " <_2_ZCHGZBH> " & MSFlexGrid1.TextMatrix(k, 1) & " </_2_ZCHGZBH> "
   

大家好,我用上面一个东西赋值  TF1.text = & ......

vb打印

要用vb打印一条线,长度是100毫米怎么写?
关注

VB code:
Printer.ScaleMode = vbMillimeters
Printer.Line (10, 10)-(110, 10)

    Printer.ScaleMode = vbMillimeters
    Print ......

VB修改注册表

用VB怎么只针对windows自带的文件的右键添加菜单 如(.txt .doc)
这个是只针对以这两个为扩展名的文件操作
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\txtfile\shell\[随便起名]\command]
@= ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号