Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2005, 10:58 AM
Registered User
 
Join Date: May 2005
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?
 
Old May 31st, 2005, 04:11 AM
Friend of Wrox
 
Join Date: Jun 2003
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.
 
Old June 4th, 2005, 05:50 PM
Authorized User
 
Join Date: Jun 2005
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?

 
Old June 7th, 2005, 10:44 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for help code works fine now.






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





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