Re: VS 2003.net

From: Mark Martin (mmartin_at_brodie.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 10:01:50 -0500

Hi

Someone replied requesting some samples of failing code:
The following Try..catch statement does not always work:

Try
    NNoteId = myNotes.Create(mybizUser, AddString)
    NumNotesCon = NumNotesCon + 1
Catch myE As Exception
    Try
                  If myNotes Is Nothing Then
                    myNotes = New
Microsoft.CRM.Platform.Proxy.CRMNotesManager
                    myNotes.Credentials =
System.Net.CredentialCache.DefaultCredentials
                    myNotes.Url = StrDir & "CRMNotesManager.srf"
                  End If
                  If RetryCreateUpdate() = True Then
                    NNoteId = myNotes.Create(mybizUser, AddString)
                    NumNotesCon = NumNotesCon + 1

                    etc...
     end try
end try

If the original line of code fails I want to catch the error and check and
retry some connections and then try the create function again. However I get
a connection failed popup error which is possible and the reason I want to
trap any error caused by this line. I am not new to ado, I am new to .net
however I can step thru my code and see that the catch statement is not
working or in some cases it is woking however the error still pops up. This
seems to be mostly a problem on win 2003.

Isdbnull sample

isdbnull(myRS.Fields(5).Value)=True then ......

myRS is an ado recordset connecting to an ODBC database and a single table.
The statement simply does not always return the correct true/false value
based on the field value, regardless of the OS.

"Mark Martin" <mmartin@brodie.com> wrote in message
news:eeUSMGfvEHA.720@TK2MSFTNGP10.phx.gbl...
> Hi All
>
> I am having a couple problems with VS 2003 VB.net especially when
deploying
> and running my app on Win 2003 small business server. The app is a simple
> but intensive windows form application using ado to retrieve data from an
> ODBC database and then populate a MS CRM database using web services.
>
> 1. The try... catch statement does not appear to work all the time and
> generates an unhandled error even though the line of code causing the
error
> is in the try statement.
>
> 2. IsDBNull does not return the correct value causing runtime errors.
>
> Does anyone know if these are bugs or is there something specific I need
to
> know for this to work.
>
>
>



Relevant Pages

  • Re: ADO - Bad when it is time to Optimize
    ... in COM-ATL and the data access is thru ADO to SQL. ... You cannot set the max pool size. ... There is no way to disable the pooling ... You cannot know whether non-pooled connections are happening ...
    (microsoft.public.data.ado)
  • Re: MS Access 97 vs. XP/2003
    ... > be a web-based app). ... All the connections to the SQL DB are via ADO. ... recordset, containing modified data, may or may not come back eventually. ...
    (microsoft.public.access.modulesdaovba)
  • app roles and ADO connections
    ... I'm having problems with the combination of SQL Server ... application roles and ADO connections. ... problematic since the approles is strictly a SQL Server ... In some cases ADO will create additional connections ...
    (microsoft.public.sqlserver.security)
  • ADO question
    ... I've been using ODBC for all of my DB connections, ... searching for something that is coherent regarding ADO. ... When I issue this command in an SQL command line, ...
    (microsoft.public.vc.mfc)