Wrox Programmer Forums
BOOK: Beginning Access 2003 VBA
This is the forum to discuss the Wrox book Beginning Access 2003 VBA by Denise M. Gosnell; ISBN: 9780764556593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access 2003 VBA 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 October 16th, 2010, 05:43 PM
Registered User
Join Date: May 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch5 TestFind() Method Error

I am trying to run TestFind() method example, but getting this error:
"Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', SELECT', or 'UPDATE'."

The error occurs on: .Open "tblContacts", CurrentProject.Connection

Private Sub cmdFind_Click()

    Dim rsFind As ADODB.Recordset
    'create a new instance of a recordset
    Set rsFind = New ADODB.Recordset
    'Set various properties of the recordset
    With rsFind
        .CursorType = adOpenStatic
        .Open "tblContacts", CurrentProject.Connection
    End With
End Sub
In the book is written explicitly "Notice how the preceding example does not use a separate connection object, but uses the existing connection for the project to create the recordset. This is an acceptable way if you will always be working with the same database of your current project."

Well, I am working within the same database, any ideas please?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch5 To Do List EricTapia BOOK: Professional Android 2 Application Development 1 April 8th, 2010 01:29 AM
Ch5 Problem klc7 BOOK: Beginning Access 2003 VBA 0 December 18th, 2009 02:13 PM
Ch5 Ex5_03 yetri56 BOOK: Ivor Horton's Beginning Visual C++ 2005 1 April 14th, 2008 02:36 AM
CH5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 8th, 2007 01:19 PM
CH5 p 184 wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 November 17th, 2003 04:41 PM

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