Saturday, March 24, 2012

Server Unavailable Error Message.

When I run my .aspx page I get a server inavailabel error.
It appears to be some kind of odbc error.. Here are the details:
In the event log it says:
1. aspnet_wp.exe (PID: 7012) stopped unexpectedly.
2. The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
Component Prog ID: 0[ODBC][Env 164f14e8]
Method Name: IDispenserDriver::CreateResource
Process Name: aspnet_wp.exe
The serious nature of this error has caused the process to terminate.
Exception: C0000005
Address: 0x1F7D5694
Call Stack:
odbc32!CloseODBCPerfData + 0x32E

Does anyone know how I might try to correct this.
ThanksCould you post some code to give us a better idea of what you are doing.

Thanks
Greg
Greg,
I am connection to db2 an filling retrieveing some data.
Here is my code.

Try

Dim str_Db2ConnString As String = "dsn=dev04;UID=ddb2btch;PWD=Db2$btch#02;"
Dim connDb2 As New Odbc.OdbcConnection(str_Db2ConnString)

Dim str_sql As String = "SELECT b.cust_num, b.credit_line_num, a.cust_short_name, b.usd_util_amt, b.activation_date FROM db2ib.ibtcust a, db2ib.ibtcred b where a.cust_num = b.cust_num order by a.cust_short_name"

' OdbcDataAdapter Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
Dim myDA As System.Data.Odbc.OdbcDataAdapter = New System.Data.Odbc.OdbcDataAdapter(str_sql, connDb2)

' the datset is what holds the results from the database.
Dim myDS As DataSet = New DataSet
myDA.Fill(myDS, "Custs")
Dim objTable As DataTable
Dim objRows(), objRow As DataRow
objTable = myDS.Tables("Custs")
'objRows = objTable.Select("cust_num = '254038'")
objRows = objTable.Select()
Dim iSub3 As Integer

Response.Write("Data from Db2" & "<br>")
For Each objRow In objRows
Response.Write(iSub3 & " & Cust_Num = " & objRow.Item(0) & "<br>")
iSub3 = iSub3 + 1
Next

' Try to load a second sql resultset into the dataset.
str_sql = "SELECT ibs_branch, short_name from db2ib.ibtbrch order by ibs_branch"

' OdbcDataAdapter Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
Dim myDA2 As System.Data.Odbc.OdbcDataAdapter = New System.Data.Odbc.OdbcDataAdapter(str_sql, connDb2)

' the datset is what holds the results from the database.
'Dim myDS2 As DataSet = New DataSet
myDA2.Fill(myDS, "Branches")
'Dim objTable As DataTable
'Dim objRows(), objRow As DataRow
objTable = myDS.Tables("Branches")
objRows = objTable.Select()
'Response.Write("myDs.Tables.Count = " & myDS.Tables(0).TableName & "<br>")
iSub3 = 1
For Each objRow In objRows
Response.Write(iSub3 & " " & objRow.Item(0) & "<br>")
iSub3 = iSub3 + 1
Next

myDS.Dispose()
myDA.Dispose()
myDA2.Dispose()

connDb2.Close()
connDb2 = Nothing

Catch MyOdbcException As OdbcException
Dim i As Integer
Response.Write(MyOdbcException.ToString)
Catch MyException As Exception
Response.Write(MyException.ToString)
Catch SysException As NullReferenceException
Response.Write(SysException.ToString)

End Try


Thanks,
Brian

0 comments:

Post a Comment