VBGood网站全文搜索 Google

首页 - 经验之谈 - VB在Access和Sql Server中通佩符
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:12112, 日期:2001-01-23
Important differences between Access, VB and SQL Server wildcard characters

Visual Basic gives you several ways to provide pattern-matches in a
search string. Typically, you use pattern-matching characters for two
purposes: to search for strings in a VB application注释:s GUI or variable,
or to look for items within a database, such as Access or SQL. When you
search for pattern matches in a database, however, depending on which
database you注释:re using, different characters perform different matches.

The following list shows the different characters used by each database:

Required Match
Any single character
               Access/VB: ? SQLServer: _
Zero or more characters
               Access/VB: * SQLServer: %
Any single digit (0-9)
               Access/VB: # SQLServer: n/a
Any single character in charlist
               Access/VB: [charlist] SQLServer: [charlist]
Any single character not in charlist
               Access/VB: [!charlist] SQLServer: [^charlist]

Keep in mind that when you use Visual Basic注释:s SQL Builder to create SQL
statements, it only accepts SQL Server pattern-matching characters--even
when you注释:re pulling data from an Access database.