p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB 2005 > BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
I forgot my password Register Now
Register | FAQ | Members List | Calendar | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 6th, 2006, 06:58 AM
Thearon's Avatar
Wrox Author
Points: 1,228, Level: 13
Points: 1,228, Level: 13 Points: 1,228, Level: 13 Points: 1,228, Level: 13
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 381
Thanks: 0
Thanked 6 Times in 6 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old November 6th, 2006, 06:06 PM
Thearon's Avatar
Wrox Author
Points: 1,228, Level: 13
Points: 1,228, Level: 13 Points: 1,228, Level: 13 Points: 1,228, Level: 13
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 381
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I'm glad the problem is resolved.

Thearon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 06:39 AM
passing input parameter to sql server sproc Jeremy Goldman ASP.NET 1.1 1 January 19th, 2004 05:10 PM
passing input to a query mirage Access 3 October 23rd, 2003 09:43 AM



All times are GMT -4. The time now is 05:36 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc