Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old October 6th, 2004, 12:45 PM
sura sura is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 sura User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy find command syntax

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

Reply With Quote
  #2  
Old October 6th, 2004, 06:08 PM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
Talking

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

Reply With Quote
  #3  
Old October 7th, 2004, 11:34 AM
sura sura is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 sura User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Darius
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


***Thanks for your help, I will try this, I appreciate it Darius
Sura 10/7/04

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > find command syntax


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway