Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2005, 10:58 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding Records

Quite new to vb am working my way through peter wright's beginning vb 6. On page 491 in the database section you can add a find next button. it uses the code

adodc1.recordset.find "[Year Published] = " & txtFindYear, 1

I am not following the books examples instead using the examples to create my own programs.

I am creating a small customer database.

I need to create a search button to find next surname.

I used the code

adodc1.recordset.find "[Customer Surname] = " & txtFindName, 1

but i receive the error message

run-time error '3001';

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

The first line of code seems to work fine with numbers but not with text.

Is there something missing for text?
Reply With Quote
  #2 (permalink)  
Old May 31st, 2005, 04:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

text needs to be surrounded with single quote ' so try:
Code:
adodc1.recordset.find "[Customer Surname] = '" & txtFindName & "'", 1
why are you "just starting" with vb6? vb.net is the latest.
Reply With Quote
  #3 (permalink)  
Old June 4th, 2005, 05:50 PM
Authorized User
 
Join Date: Jun 2005
Location: Seattle, WA, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Likely because, like myself, they *OWN* VB 6, and don't have the 550$ to shell out for VB.Net?

Reply With Quote
  #4 (permalink)  
Old June 7th, 2005, 10:44 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for help code works fine now.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Finding records within Access Pharasite Classic ASP Databases 7 June 30th, 2004 03:39 AM
finding total no. of records reshmisworld Classic ASP Databases 4 July 24th, 2003 06:35 PM
finding total no. of records reshmisworld Classic ASP Databases 1 July 24th, 2003 03:23 PM



All times are GMT -4. The time now is 01:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.