Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 5th, 2006, 03:46 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing an Input Field to a Parameter Query

Beginning Visual Basic 2005 Databases.
Try It Out on page 102
I keep getting error on the following line:

objCommand.Parameters.Add("@ProjectID", OleDbType.Guid, 16).Value = _
            New Guid(txtProjectID.Text)

The error is:
FormatException was unhandled
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

I thought I had mistyped the code, but I get the same error with the downloaded code.

Note: I am using Visual Basic 2005 Express Edition.

Thanks for any help.


Reply With Quote
  #2 (permalink)  
Old November 6th, 2006, 06:58 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Is the ProjectID field in your Access database defined as a Number and set to a Field Size of Replication ID? If this is the case then you'll need to look up in the online help for Visual Studio the constructor for the GUID structure. I do not have the Express edition installed nor do I have access to a test machine that I can install it on.

Thearon
Reply With Quote
  #3 (permalink)  
Old November 6th, 2006, 05:13 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, the ProjectID is defined as Number with filed size set to Replication ID.

I've been thru the VB online help already, but at this point in learning, nothing jumps out at me as to how to correct this error.


Reply With Quote
  #4 (permalink)  
Old November 6th, 2006, 05:58 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured out what I was doing wrong. Not sure what I was thinking but I was clicking on the Parameter Query button before entering the GUID (duh ...). And since the exception for an invalid GUID (blank) was unhandled I got the error shown above.


Reply With Quote
  #5 (permalink)  
Old November 6th, 2006, 06:06 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I'm glad the problem is resolved.

Thearon
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
passing xml document as input parameter to web ser neerom XSLT 7 November 14th, 2008 12:58 PM
Passing Input Date Parameter values preethig Crystal Reports 0 February 28th, 2008 08:39 AM
passing parameter to query vladimir Access 6 August 30th, 2006 05:39 AM
passing input to a query mirage Access 3 October 23rd, 2003 08:43 AM



All times are GMT -4. The time now is 11:33 PM.


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