Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 Search this Thread Display Modes
  #1 (permalink)  
Old October 8th, 2007, 03:26 AM
Registered User
 
Join Date: Oct 2007
Location: , , India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB5.0 to VB .Net upgradation issue related to DAO

hi
I am facing a issue related to DAO.DBEngine. In previous VB5.0 application the database related errors are captured by DAO.DBEngine.Errors method.
The code like this,

Friend DAODBEngine_definst As New DAO.DBEngine
If DAODBEngine_definst.Errors(0).Number = 20023 Then
    MsgBox("Password matches with one of the prior passwords")
              Exit Sub
End If

after upgradation in VB .Net 2005 we are using Microsoft.Practices.EnterpriseLibrary
for datbase handling.
In new .Net applicaton error handling is done by using Try catch block
so can any one suggest me the replacement code of line "DAODBEngine_definst.Errors(0).Number = 20023 " .

This should be like
  catch ex as Exception
    If (ex. (some code)= 20023 )then
     MsgBox("Password matches with one of the prior passwords")
            Exit Sub
    End If
End try

ultimately how can i capture the error number in catch block.
 can i use Microsoft.VisualBasic.ErrObject to capture error number
Is it working same as DBengine.Error(0).number?
Thanks



Reply With Quote
  #2 (permalink)  
Old October 10th, 2007, 03:15 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The connection object should have an error collection that you can examine.
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
Session Related Issue asmii Beginning PHP 3 October 5th, 2008 07:07 PM
Date Related Issue Kirti.darji Visual Studio 2005 0 May 13th, 2008 06:40 AM
Zend Framework Related Issue Rajat Kumar Beginning PHP 0 May 6th, 2008 07:00 AM
VB.NET logic Issue. boycomputer Visual Studio 2005 1 September 20th, 2006 11:36 PM
VB.NET DAO DSN??? Blahcutey Access VBA 2 November 18th, 2004 07:08 PM



All times are GMT -4. The time now is 08:55 AM.


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