Good Day People
Please help me, I'm trying to do a do until loop, which can search the database to match the value that is entered in the vb6.0 textbox. but I don't know what to call the value in the database.
It looks something like this.
dim productid as integer
productid=me.productid.text
Do until productid=product_id(this is the value I don't know what to call, it is the value in the database)
PLEASE HELP.
mpande
0
Newbie Poster
Recommended Answers
Jump to Posthi, this might give you an idea:
num = 1 ' initialize counter 'rs is the reference to your recordset change if needed Do While Not rs.EOF ' See if the data has been found If product_id = rs!product_id Then 'do something here End If ' If …
Jump to Postif it is a specific item you are looking for why search through mulitple records?
sSQL = "Select fields from table where id = " & productid & "
then you can run your do while.
Jump to Postor if it is a partial product id no then...
"Select * from table where productid like '" & sometext & "*'"
if it is text or if not remove the single ticks (')
Good Luck
Jump to Postwhat are you using to connect to the DB? i am guessing something like this:
Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Set cn = New ADODB.Connection cn.Open 'connection string Set rs = New ADODB.Recordset rs.Open "Select fields from table where id = " & productid.text …
Jump to PostThanks For your help, Proffessor PC.
I think it works, but won't see that properly now because it gives an error later on when I say: if productid=rs!product_id then
rs.open"select fields from table", "update field set data"
but it gives me an error on open(wrong number of arguments or invalid …
All 27 Replies
cguan_77
8
Nearly a Posting Virtuoso
Ole Raptor
19
Posting Whiz in Training
vb5prgrmr
143
Posting Virtuoso
mpande
0
Newbie Poster
Ole Raptor
19
Posting Whiz in Training
mpande
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
mpande
0
Newbie Poster
Ole Raptor
19
Posting Whiz in Training
mpande
0
Newbie Poster
Ole Raptor
19
Posting Whiz in Training
mpande
0
Newbie Poster
Ole Raptor
19
Posting Whiz in Training
mpande
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
mpande
0
Newbie Poster
Ole Raptor
19
Posting Whiz in Training
mpande
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
mpande
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
mpande
0
Newbie Poster
jccaldz
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
mpande
0
Newbie Poster
cguan_77
8
Nearly a Posting Virtuoso
omoridi
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.