如题,谢谢!!!
解决方案 »
- 大哥们,又要请你们帮忙了!
- 将从数据库中的一张表中查询出来的结果集写到另外一张表中
- 菜鸟提问,vb中有关存储过程的问题,急急!!!
- 水晶报表连接的问题,1.做了个*.rpt文件路径为d:\xfdk\*.mdb 2.程序中调用时是在app.path\*.mdb 3.为什么在用户用户哪里还要找设计用到
- 50分,急求用winsock编写的简单邮件发送程序,9点之前发到...
- Execl表 最上面那一栏(ABC..那栏)怎么修改啊
- 用VB打不开EXCEL,附代码!大哥们帮我看看!~
- 请问,如何在VB6.0中显示Gif文件
- ADO异步的问题
- 如何将ACCESS数据库中的数据永久删除?用代码,分不多,但很简单呀
- 标准模块的问题。
- 水晶报表打印问题
template As String, CaseSensitive As Boolean) _
As Integer' Returns the number of times template occurs in target.
' Returns -1 if either string is blank or if templateis longer than target. If CaseSensitive is true, performs a case-sensitive comparison for text. If false, the comparison is case-insensitive.
Dim pos1 As Integer, pos2 As Integer, count As IntegerIf Len(target) = 0 Or Len(template) = 0 Or _
Len(template) > Len(target) Then
CountSubstrings = -1
Exit Function
End If count = 0
pos2 = 1
Do
If CaseSensitive Then
pos1 = InStr(pos2, target, template, vbBinaryCompare)
Else
pos1 = InStr(pos2, target, template, vbTextCompare)
End If
If pos1 > 0 Then
count = count + 1
pos2 = pos1 + 1
End If
Loop Until pos1 = 0CountSubstrings = countEnd Function 这个函数名叫做CountSubstrings。你在搜索指定字符串,寻找需要模版字符串,在不区分大小写并指定了布林逻辑运算元的情况下搜索文本的时候可以使用它。注意,这个代码在下面三种情况下可能会出现错误:1 目标字符串是空白的;2 模版字符串是空白的;3 模版字符串长于目标字符串。发生三种情况中任一种,函数的返回值是-1。
http://vbboshi.myrice.com/vbtech/value/page_2/file32.htm