传递SQL“喜欢”从VB代码到查询参数的字符串。 [英] Passing SQL "Like" string from VB code into Query Parameter.
问题描述
我有一个名为FalconAnalysis.mdb的数据库。我想要使用的表称为通用材料。我想将值传递给的查询称为Material Query。查询中的字段称为Order_Model。我想将结果strSize从以下代码字符串传递到Material Query的Order_Model字段,该字段查看通用材料表。
I have a Database Called FalconAnalysis.mdb. The table I am wanting to use is called Generic Material. The Query I want to pass the value into is called Material Query. The field in the query is called Order_Model. I would like to pass the result, "strSize", from the following string of code into the Order_Model field of Material Query, which looks at generic Material Table.
推荐答案
我有一个数据库调用FalconAnalysis.mdb。我想要使用的表称为通用材料。我想将值传递给的查询称为Material Query。查询中的字段称为Order_Model。我想将结果strSize从以下代码字符串传递到Material Query的Order_Model字段,该字段查看通用材料表。
I have a Database Called FalconAnalysis.mdb. The table I am wanting to use is called Generic Material. The Query I want to pass the value into is called Material Query. The field in the query is called Order_Model. I would like to pass the result, "strSize", from the following string of code into the Order_Model field of Material Query, which looks at generic Material Table.
看起来更像是In Construct给我:
strPassSQL =" In(& strSize&")"
Looks more like the In Construct to me:
strPassSQL = "In(" & strSize & ")"
这是进入查询还是VB代码?
Does that go into the query, or the VB code?
看起来更像是In Construct给我:
strPassSQL =" In(& strSize&")"
Looks more like the In Construct to me:
strPassSQL = "In(" & strSize & ")"
你不能将此作为查询的标准。我认为没有办法运行代码来改变查询本身的查询标准。
你很可能必须通过表格。
You can''t have this as the criteria of a query though. I don''t think there''s a way to run code which will change the criteria of a query from the query itself.
You''ll most likely have to do it through a form.
这篇关于传递SQL“喜欢”从VB代码到查询参数的字符串。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!