|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have created a user interface using visual basic 6, each file or account has basic information name and address and so on. I have also created a table to access all the files, and add a new file to the end of the list with unique account number. My problem is I want to also create a command button to find a specific file by seatching any field in the account say I want to search all the files that contain in first name JOHN or last name as JONES, and all the files would come up in the search or displayed in the search.
I don't want to use dialog boxes to ask this question, my approach must be as follows, clear the screen first, a find button will appear on the screen, and then the user will type in the first name field say JOHN and then click the find button, and that record should be displayed and if it doesn't exist then there should be an error. I guess my problem is how do I do this just like the commands in the ado file in the access. I have tried using the connection between the text entered and comaring it to the recordset's data, which I had no sucess. I need your help Thank you Sura |
|
#2
|
|||
|
|||
|
If you know how to open a connection in VB is just using the recordset
Dim Conn As ADODB.Connection, regs1 As New ADODB.Recordset TXT="select * from customers " if cust_Fname.text <>"" then TXT= TXT & "first_name='" & cust_fname.text & "' " if cust_lname.text <>"" then if cust_Fname.text <>"" then TXT = TXT & " and " TXT="last_name='" & cust_lname.text & "'" end if regs1.open TXT, Conn, adOpenKeyset, adLockOptimistic 'then loop tru the records. While not(regs1.eof) ..... wend note: I don't added the code for creating a new connection to do the example lighter |
|
#3
|
|||
|
|||
|
Quote:
***Thanks for your help, I will try this, I appreciate it Darius Sura 10/7/04 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > find command syntax |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|