访问查询/搜索条件 [英] Access queries/ Search criteria
问题描述
我正在使用Access数据库在
MS VB.net 2005 express中搜索/添加大量信息。在查询(querybuilder)中,一切似乎都是正确的,但在WHERE语句中我使用[Number] = me.textbox.text。
然后在声明我有一个if语句
IF combobox.text = option1然后
e.databaseadapter.GetDataBy2()''这是我建立的查询
我每次都会收到错或执行。是否有搜索批评字段我需要
来代替me.textbox.text?
< blockquote> 2007年4月18日05:17:50 -0700, Ri*****@gmail.com 写道:
$ b $b¤我正在使用Access数据库在
$ b $b¤MSVB.net 2005 express中搜索/添加一堆信息。在查询(querybuilder)中,一切似乎都是正确的,但在WHERE语句中我使用[Number] = me.textbox.text。
$ b $b¤
$ b $b¤然后在声明中我有一个if声明
$ b $b¤
$ b $b¤IFcombobox.text = option1然后
$ b $b¤e.databaseadapter .GetDataBy2()''这是我建的查询
$ b $b¤结束如果
$ b $b¤
$ b $b¤我每次都会收到错误,并且可以要弄清楚它是否与sql
$ b $b¤语句或执行有关。是否有搜索批评字段我需要
$ b $b¤代替me.textbox.text?
生成的错误是什么? BTW,Number是一个Jet保留字,所以它可能不是一个很好的选择。
Paul
~~~~
Microsoft MVP(Visual Basic)
4月18日上午9:59,Paul Clement
< UseAdddressAtEndofMess ... @ swspectrum.comwrote:
2007年4月18日05:17:50 -0700,Riva ... @ gmail.com写道:
$ b $b¤我正在使用Access数据库在
$ b $b¤MSVB.net 2005 express中搜索/添加大量信息。在查询(querybuilder)中,一切似乎都是正确的,但在WHERE语句中我使用[Number] = me.textbox.text。
$ b $b¤
$ b $b¤然后在声明中我有一个if声明
$ b $b¤
$ b $b¤IFcombobox.text = option1然后
$ b $b¤e.databaseadapter .GetDataBy2()''这是我建的查询
$ b $b¤结束如果
$ b $b¤
$ b $b¤我每次都会收到错误,并且可以要弄清楚它是否与sql
$ b $b¤语句或执行有关。是否有搜索批评字段我需要
$ b $b¤代替me.textbox.text?
生成的错误是什么? BTW,Number是一个Jet保留字,所以它可能不是一个很好的选择。
Paul
~~~~
Microsoft MVP(Visual Basic)
这基本上就是我得到的错误。
http://img107.imageshack.us/img107/8965/vbcn6。 jpg
4月18日下午1点34分,Riva ... @ gmail.com写道:
4月18日上午9:59,Paul Clement
< UseAdddressAtEndofMess ... @ swspectrum.comwrote:
2007年4月18日05:17:50 -0700,Riva ... @ gmail.com写道:
$ b $b¤我正在使用Access数据库在
$ b $b¤MSVB.net 2005 express中搜索/添加一堆信息。在查询(querybuilder)中,一切似乎都是正确的,但在WHERE语句中我使用[Number] = me.textbox.text。
$ b $b¤
$ b $b¤然后在声明中我有一个if声明
$ b $b¤
$ b $b¤IFcombobox.text = option1然后
$ b $b¤e.databaseadapter .GetDataBy2()''这是我建的查询
$ b $b¤结束如果
$ b $b¤
$ b $b¤我每次都会收到错误,并且可以要弄清楚它是否与sql
$ b $b¤语句或执行有关。是否有一个搜索批评字段我需要
$ b $b¤代替me.textbox.text?
生成的错误是什么?顺便说一下,Number是一个Jet保留字,所以它可能不是列名的好选择。
Paul
~~~~
Microsoft MVP(Visual Basic)
这基本上就是我得到的错误。
http://img107.imageshack.us/img107/8965/vbcn6.jpg- 隐藏引用的文字 -
- 显示引用文字 -
任何想法?
I am using a Access Database to search/add a bunch of information in
MS VB.net 2005 express. In the query (querybuilder) everything seems
right, but in the WHERE statement I use [Number] = me.textbox.text .
Then in the statement I have an if statement
IF combobox.text = option1 Then
e.databaseadapter.GetDataBy2() ''which is the query i built
end if
I get an error each time, and can''t figure out if it is with the sql
statement, or the execution. Is there a search critria field i need
to put in place of me.textbox.text?
On 18 Apr 2007 05:17:50 -0700, Ri*****@gmail.com wrote:
¤ I am using a Access Database to search/add a bunch of information in
¤ MS VB.net 2005 express. In the query (querybuilder) everything seems
¤ right, but in the WHERE statement I use [Number] = me.textbox.text .
¤
¤ Then in the statement I have an if statement
¤
¤ IF combobox.text = option1 Then
¤ e.databaseadapter.GetDataBy2() ''which is the query i built
¤ end if
¤
¤ I get an error each time, and can''t figure out if it is with the sql
¤ statement, or the execution. Is there a search critria field i need
¤ to put in place of me.textbox.text?
What is the error that is being generated? BTW, Number is a Jet reserved word so it may not be a
good choice for a column name.
Paul
~~~~
Microsoft MVP (Visual Basic)
On Apr 18, 9:59 am, Paul Clement
<UseAdddressAtEndofMess...@swspectrum.comwrote:On 18 Apr 2007 05:17:50 -0700, Riva...@gmail.com wrote:
¤ I am using a Access Database to search/add a bunch of information in
¤ MS VB.net 2005 express. In the query (querybuilder) everything seems
¤ right, but in the WHERE statement I use [Number] = me.textbox.text .
¤
¤ Then in the statement I have an if statement
¤
¤ IF combobox.text = option1 Then
¤ e.databaseadapter.GetDataBy2() ''which is the query i built
¤ end if
¤
¤ I get an error each time, and can''t figure out if it is with the sql
¤ statement, or the execution. Is there a search critria field i need
¤ to put in place of me.textbox.text?
What is the error that is being generated? BTW, Number is a Jet reserved word so it may not be a
good choice for a column name.
Paul
~~~~
Microsoft MVP (Visual Basic)This is basicly the error I get.
http://img107.imageshack.us/img107/8965/vbcn6.jpg
On Apr 18, 1:34 pm, Riva...@gmail.com wrote:On Apr 18, 9:59 am, Paul Clement
<UseAdddressAtEndofMess...@swspectrum.comwrote:On 18 Apr 2007 05:17:50 -0700, Riva...@gmail.com wrote:
¤ I am using a Access Database to search/add a bunch of information in
¤ MS VB.net 2005 express. In the query (querybuilder) everything seems
¤ right, but in the WHERE statement I use [Number] = me.textbox.text .
¤
¤ Then in the statement I have an if statement
¤
¤ IF combobox.text = option1 Then
¤ e.databaseadapter.GetDataBy2() ''which is the query i built
¤ end if
¤
¤ I get an error each time, and can''t figure out if it is with the sql
¤ statement, or the execution. Is there a search critria field i need
¤ to put in place of me.textbox.text?
What is the error that is being generated? BTW, Number is a Jet reserved word so it may not be a
good choice for a column name.
Paul
~~~~
Microsoft MVP (Visual Basic)
This is basicly the error I get.
http://img107.imageshack.us/img107/8965/vbcn6.jpg- Hide quoted text -
- Show quoted text -Any Ideas?
这篇关于访问查询/搜索条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!