Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
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 June 4th, 2006, 05:38 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Statement Is Not Valid In A Namespace

Hello,

I am working in Chapter 5 Beginning VB 2005 Databases

When hit start debugging. I get three errors - one for each button created.

btnCloseConnection
btnOpenConnection
btnDatabase

The error is "StatementNotValidInANamespace"

Whatever is the problem applies to all three? What did I do wrong?

Thanks, KennyG
 
Old June 4th, 2006, 09:32 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All of your code needs to be in a class.
This error is telling you that it is outside of the class definition, and is instead in the namespace block.

A namespace block encloses a class block - but only certain things can go into the namespace block directly.



Woody Z http://www.learntoprogramnow.com
 
Old June 4th, 2006, 02:02 PM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help, that was it.

KennyG





Similar Threads
Thread Thread Starter Forum Replies Last Post
Specified cast is not valid heba ASP.NET 2.0 Professional 1 May 27th, 2007 08:51 PM
valid crmpicco Classic ASP Basics 1 February 17th, 2005 12:54 AM
valid? crmpicco Classic ASP Basics 3 February 8th, 2005 05:46 AM
valid ASP crmpicco Classic ASP Basics 3 January 27th, 2005 05:54 AM





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