0

Greetings!
Hi, I'm a vb starter. I've inserted an adodc data control into a form.

With adodcIncoming
        .Recordset.Find "p_id = " & "'" & txtPatientId.Text & "'"

Above is a code snippet. After this block of codes, I'd like to check if p_id = txtPatientId.Text is found or not, how can I do that?

I know that with a data control, I could use .Recordset.NoMatch method. However, with an adodc, it's not available.
Please help.

Regards.

6
Contributors
6
Replies
7
Views
13 Years
Discussion Span
Last Post by AndreRet
0

Well here is my point on this. Why not loop through the recordset (which is an abstraction of a table object, based on criteria you have specified) until p_id = txtPatientId.Text ?

i.e. (pseudo-code)

Do until .recordset.EOF
if p_id = txtPatientid.Text then
' then do what you must
end if
.recordset.MoveNext
Loop

Patient ID eh? Are we doing some sort of a program related to medicine?

Hope this helps!

0

Greetings.
Why haven't I thought of that way?
LOL. Thanks a lot! Yeah, it's a clinic medical system.
Thanks.

0

Greetings!
Hi, I'm a vb starter. I've inserted an adodc data control into a form.

With adodcIncoming
        .Recordset.Find "p_id = " & "'" & txtPatientId.Text & "'"

Above is a code snippet. After this block of codes, I'd like to check if p_id = txtPatientId.Text is found or not, how can I do that?

I know that with a data control, I could use .Recordset.NoMatch method. However, with an adodc, it's not available.
Please help.

Regards.

''use this code rather than the other one because if your record in the database
'' composed of thousands of records or millions, it would hang your system and
'' waste your time...

With adodcIncoming
.requery '
.Recordset.Find "p_id = " & "'" & txtPatientId.Text & "'"
if .recordset.eof then msgbox "no record was found" else msgbox"gotcha!!!"
end with

0

is ADODC capable of multiple search such as:

"id = '" & text1.text & "' or lastname = '" & text1.text & "'"
0

how to save data using ado data control?
what is the code for that?
help me pls11

0

Try -

Adodc2.Update

Please open a new post with your question seeing that this post is already 4 years old, pleeeeease.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.