Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 Display Modes
  #1 (permalink)  
Old October 16th, 2010, 05:43 PM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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

Code:
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?
Reply With Quote
Reply


Thread Tools
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
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 01: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 12: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 03:41 PM



All times are GMT -4. The time now is 09:57 PM.


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