Home > Software engineering >  Temporarily suspended vb help search results assigned to a string of problems
Temporarily suspended vb help search results assigned to a string of problems

Time:11-10


Now, I want to query in the vb program SCLL table, query meet two conditions (scll_scph and scll_wlbh satisfy conditions) results (output scll_scjhd) then SCJHD multiple values to a string, for reference in the textbox, use multiple results, separated, and remove duplicate values;
Such as query WL004/20200202, should be output "JH20051227002, JH20051227003
"Who help me to solve, be obliged!
The code I wrote:
Rs22. Open the "select * from tb_SCGL_scll where scll_wlmc='" + Cbx_Field. Text +"' and scll_scph='" + Txt_Key. Text + "' ", CNN, adOpenKeyset
If rs22. RecordCount & gt; 0 Then
For I=0 To rs22. RecordCount - 1
The name 'LLL=rs22. Fields (" scll_scjhd ")
Rs22. MoveNext
Next I
End the If
Rs22. Close
Output is only one, and the other how to display at the same time? The name 'LLL=JH20051227003, how to let the name' LLL=JH20051227002, JH20051227003 thank you

CodePudding user response:

Teachers, please help! Thanks a lot

CodePudding user response:

https://bbs.csdn.net/topics/392464822
Is essentially how to combine multiple records set a field, use commas

CodePudding user response:

refer to the second floor X - I - n reply:

https://bbs.csdn.net/topics/392464822Is essentially how to combine multiple records set a field, use commas

The webmaster, it's not suitable for use by vb6.0 by use? Look not to understand this sentence

CodePudding user response:

Try this line not line:
 
Dim dict
The set dict=createobject (" scripting. The dictionary ")

Rs22. Open the "select * from tb_SCGL_scll where scll_wlmc='" + Cbx_Field. Text +"' and scll_scph='" + Txt_Key. Text + "' ", CNN, adOpenKeyset
If rs22. RecordCount & gt; 0 Then
For I=0 To rs22. RecordCount - 1
Dict. Item (CSTR (rs22 Fields (" scll_scjhd ")))=null
Rs22. MoveNext
Next I
End the If
Rs22. Close
The name 'LLL=""
Dim key
For each key in dict
If the name 'LLL="" then
The name 'LLL=key
The else
The name 'LLL=name' LLL & amp; ", "& amp; The key
End the if
Next
  • Related