943,852 Members | Top Members by Rank

Ad:
Apr 8th, 2009
-1

using find in visual basic 6

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
locsin is offline Offline
47 posts
since Aug 2007
Apr 8th, 2009
0

Re: using find in visual basic 6

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.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Apr 10th, 2009
0

Re: using find in visual basic 6

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Creating an Object in Project1 from a Class in Project2
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: ICQ captures Webbrowser component beforenavigate event





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC