|
|
 |
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.
|
 |

November 5th, 2006, 03:46 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

November 6th, 2006, 06:58 AM
|
 |
Wrox Author
|
|
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 381
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
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
|

November 6th, 2006, 05:13 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

November 6th, 2006, 05:58 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

November 6th, 2006, 06:06 PM
|
 |
Wrox Author
|
|
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 381
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
I'm glad the problem is resolved.
Thearon
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |