[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

ODBC fails if AS/400 offline

Rob T

9/25/2002 4:25:00 PM

Hi, I posted this question a couple of months ago with no results...I'm
still experiencing the same problem.....hopefully someone has experienced
the same problem?


I have a working ODBC connection to our AS/400. However, if the AS/400 is
off-line, my program just quits. I have tried an On Error event, but no
error number is raised. I saw someone else had asked a similar
question...with no results.

Any suggestions? Thanks.

PS. Here's a VP snippit of my code if it is of any use.

On Error GoTo BombOut
strSQL = "Select * from POMASTL0 where UUSAPM='1'"
dstOdbc = New DataSet()
cnnOdbcCUS = New OdbcConnection(strCUS)
dadOdbc = New OdbcDataAdapter(strSQL, cnnOdbcCUS)
dadOdbc.Fill(dstOdbc, "Info")
dataView = New DataView(dstOdbc.Tables("Info"))




1 Answer

Jonathan Scott

10/18/2002 5:41:00 PM

0

Have you tried using the following?

Try

Catch exp As Exception

End Try

I have been learning that the On Err Goto method is only in .Net for
compatibility reasons, and this is the proper way to code exception
handling.

Also, if you want to have multiple Try's, you need to nest the Try / Catch
in a loop, or sub routine, and Do While True

You should catch some of the online webinars... they are really good!


"Rob T" <rtorcellini@NOwalchemSPAM.com> wrote in message
news:OIDxe8JZCHA.2028@tkmsftngp11...
> Hi, I posted this question a couple of months ago with no results...I'm
> still experiencing the same problem.....hopefully someone has experienced
> the same problem?
>
>
> I have a working ODBC connection to our AS/400. However, if the AS/400 is
> off-line, my program just quits. I have tried an On Error event, but no
> error number is raised. I saw someone else had asked a similar
> question...with no results.
>
> Any suggestions? Thanks.
>
> PS. Here's a VP snippit of my code if it is of any use.
>
> On Error GoTo BombOut
> strSQL = "Select * from POMASTL0 where UUSAPM='1'"
> dstOdbc = New DataSet()
> cnnOdbcCUS = New OdbcConnection(strCUS)
> dadOdbc = New OdbcDataAdapter(strSQL, cnnOdbcCUS)
> dadOdbc.Fill(dstOdbc, "Info")
> dataView = New DataView(dstOdbc.Tables("Info"))
>
>
>
>