我的一个查询语句是这样的。
“select * from Table where 条件 order by 编号”现在我想取出上面语句中的 "from Table where 条件" 哪位高手能教我一下。不胜感激!!!!!!!!!!!!!!!!!!!
“select * from Table where 条件 order by 编号”现在我想取出上面语句中的 "from Table where 条件" 哪位高手能教我一下。不胜感激!!!!!!!!!!!!!!!!!!!
解决方案 »
- 如何获取通用对话框打开的文件路径?
- 如何取得远程服务器上文件的属性,比如创建时间,修改时间,大小等?
- VB中怎样捕获异常?
- 请问设置windows错误报告的地方在注册表的什么地方?我的程序在显示"发送错误报告"的时候没有图标.
- 在ACCESS数据库里可以执行,放在VB里不能执行的SQL语句 急!!!!!!!在线等!!!!!!!!!!!!
- EXCEL 的开发
- dtpicker控件怎么把时间去掉,我只要把日期存在access数据库里就行了
- 怎样取得前一月份的值?
- 如何使MsFlexGrid控件的某一列的文本居中对齐,新手的问题!
- vb与sql
- 小弟在这里求各位高手了,帮助我解决我的问题吧,圣诞节你们一定会有一个接到圣诞老人的祝福的!!
- 在新年来临之际,祝各位新年快乐,万事顺利!有一个问题请教大家,望赐教!
Dim StartPoint As Integer
Dim StrLen As Integer
a = "select * from Table where 条件 order by 编号"
StartPoint = InStr(1, a, "from")
StrLen = InStr(1, a, "order") - StartPoint
Debug.Print Mid(a, StartPoint, StrLen)
XX = "select * from Table where 条件 order by 编号"
I = InStr(XX, "order by")
If I <> 0 Then
XX = Trim(Mid(XX, 1, I - 1))
End If
MsgBox XX
dim str as string
str=“select * from Table where 条件 order by 编号”
lstrTmp=mid(str,instr(str,"from"))
lstrTmp=left(lstrTmp,instr(str,"order")-2)
注意:如果没有Order子句时,会出错;另外还要注意大小写。
Dim i As Integer
Dim j As Integer
strTemp = "select * from Table where 条件 order by 编号"
i = InStr(UCase(strTemp), UCase("from"))
j = InStr(UCase(strTemp), UCase("order"))
MsgBox Mid$(strTemp, i, j - i)
dim strSQL as string
strSQL="select * from Table where 条件 order by 编号"
ipos=instr(1,strSQL,"from")
字串=mid$(strsql,ipos+1)
Dim s As String
s = "select * from Table where 条件 order by 编号"
Debug.Print findstr("from", "条件", s)
End Sub
Private Function findstr(ByVal word1 As String, ByVal word2 As String, ByVal finds As String) As String
Dim i As Long, j As Long
i = Len(word1)
If i = 0 Then
Exit Function
findstr = ""
ElseIf i > Len(finds) Then
Exit Function
findstr = ""
End If
j = Len(word2)
If j = 0 Then
Exit Function
findstr = ""
ElseIf j > Len(finds) Then
Exit Function
findstr = ""
End If
Dim num1 As Long, num2 As Long
num1 = InStr(1, finds, word1)
If num1 = 0 Then
Exit Function
findstr = ""
End If
num2 = InStr(num1, finds, word2)
If num2 = 0 Then
Exit Function
findstr = ""
End If
Dim findlength As Long
findlength = num2 - num1 + Len(word2)
findstr = Mid(finds, num1, findlength)
End Function