Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 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 August 4th, 2008, 05:02 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Connection/Command Error Text Location

Given:
Code:
    If c Is Nothing Then
        c.ConnectionString = CnctStr() ' <——<<< A UDF.
        c.Open
        If c.State <> ConnectionState.Open Then 
            MsgBox("Failed to open connection", _
                   MsgBoxStyle.Critical, _
                   "Error")
            Exit Sub
        End If
    End If

    Dim cmd As New _
        OracleCommand("ALTER USER " & txtLogin.Text & " " & _
                      "IDENTIFIED BY " & txtNewPW.Text, _
                      c)

    Try
        cmd.ExecuteNonQuery()
    Catch ex As Exception

    End Try
    If the password cannot be used (already been used, malformed, whatever) where will the text of the error be found?

In SQL*Plus, the primitive utility for communicating with Oracle, a message like that would be on the lines below the statement. So Oracle must be returning the characters that make up the message. But where does .NET put the message?
 
Old September 8th, 2008, 06:00 AM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I Thought there is an exception thrown with the message in it. In that case you could use the catchblock. But I could be wrong.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Text import - Browse for location djgenesis Excel VBA 2 August 2nd, 2007 05:18 AM
Command text was not set for the command object Sheraz Khan Classic ASP Databases 2 May 29th, 2007 12:57 AM
Location of Access default command button icons ActuaryTm Access 2 September 16th, 2005 12:03 PM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM





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