using find in visual basic 6

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2007
Posts: 47
Reputation: locsin is an unknown quantity at this point 
Solved Threads: 0
locsin locsin is offline Offline
Light Poster

using find in visual basic 6

 
0
  #1
Apr 8th, 2009
Greetings!

I am using find command in vb6 using to conditional statement.

Call dbconek
With ar
.Open "Select *From numgroup", strconek, adOpenStatic, adLockOptimistic
.Find "numero = '" + bet + "' And "draw_date = " & DateValue(vdrawdate.Text) & "", 0, adSearchForward
If Not .EOF Then
msgbox "record is existing"
Else
msgbox "record is not existing"
End If
End With

I received error from .find command "Type mismatch Error 1"

my datafield
numero -----> string
draw_date -----> short date

my variables
bet ------------> string
vdrawdate.text --------> as textbox

the error comes from draw_date and vdrawdate.

anybody can help me or there is any other solution.

thank in advance
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,139
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 132
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: using find in visual basic 6

 
0
  #2
Apr 8th, 2009
Why not simply use the WHERE clause along with the SQL statement to find the record. You can also use COUNT to find if the record exists and then display the message accordingly. Using COUNT will be really fast.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: using find in visual basic 6

 
0
  #3
Apr 10th, 2009
Hi,

I Guess, if it is an ADO recordset, you can give Just One Column Search, (not multiple).
Like Debasis said, open another Recordset with "Where" Condition

Regards
Veena
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 605 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC