易截截图软件、单文件、免安装、纯绿色、仅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



相关问答:

vb打印问题


Printer.ScaleMode = 6
6表示毫米
Printer.PaperSize = vbPRPSA4

'初始坐标
x = 1
y = 4


'最大的线筐
Printer.DrawStyle = 0
Printer.Line (x, y)-(x + 132.5, y) ......

vb如何调用Illustrator(此前Illustrator未启动)?

请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click()
Dim app As New Illustrator.Application
Dim doc As Illustrator.Document
Dim thislayer As Illustrator.Layer ......

vb打包安装时提示输入序列号

我有自动生成序列号的程序,但是怎么跟打包后的安装程序结合在一起,在安装时提示用户输入序列号,正确后再继续安装???
方法1:你可以在运行程序后输入序列号注册,很多软件都是这样的。

方法2:使用Setu ......

VB 网页自动登陆

Option Explicit

Private Sub Command1_Click()
    WebBrowser1.Navigate "http://mc.qeedoo.com/servers.php"
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号