Intermittant Server Error reading an MS Access DB

C

Chuck Ritzke

Hi all,

I am getting an intermittant error after uploading a project from my
development machine. I click on a link which opens an aspx page that, upon
page load, reads a very small amount of data from an MS Access database,
using ODBC and a stored query. There is no problem on my development
machine. On the production server though, I get the intermittant error shown
below. If I click back and forth between the problem page and the linking
page, the error only occurs every 6th (or so) times I click on the link.
When I do get the error, the page works fine if I page back and click again,
or if I just re-load the page (until it happens again later). I read the DB
in other parts of the project and have not seen the problem anywhere else
yet.

This is my first .NET project and so I may be missing something obvious. Can
anybody tell me where I should look for this problem or what might be
causing it? I don't really understand how to use the stack info provided. Is
it some type of timing or "database not ready" thing that I need to handle?
(I've read lots of DBs in regular ASP and have had no problem like this).
Should I be trying to Catch this error somewhere (where?).

TIA,
Chuck
Server Error in '/HistoricGrowth' Application.
----------------------------------------------------------------------------
----

ERROR [22018] [Microsoft][ODBC Microsoft Access Driver] Unknown name
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [22018]
[Microsoft][ODBC Microsoft Access Driver] Unknown name

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[OdbcException: ERROR [22018] [Microsoft][ODBC Microsoft Access Driver]
Unknown name]
System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) +48

System.Data.Odbc.OdbcCommand.System.Data.IDbCommand.ExecuteReader(CommandBeh
avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
+36
clsUtil_MyDB.MyDB.GetDataSet_ODBC(DataSet dsDataSet) +556
clsUtil_MyDB.MyDB.GetDataSet(DataSet dsDataSet) +22
HistoricGrowth.HistoricGrowth.InitializePageControls() +386
HistoricGrowth.HistoricGrowth.Page_Load(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
C

Chuck Ritzke

Hello again,

I narrowed down where the error occurs by writing to a trace file. Below is
my code that builds the data adapter and attempts to fill the dataset. When
the error occurs, it occurs the first time at the DATAADAPTER.FILL line in
the FOR NEXT loop. Again, the error occurs seemingly randomly. Anybody see
anything wrong that might cause the error to occur upon occasion and what I
should do to keep it from happening???

Thanks again,
Chuck

'===========================================
Private Sub GetDataSet_ODBC(ByVal dsDataSet As DataSet)

Dim DataAdapter As New System.Data.Odbc.OdbcDataAdapter
Dim i As Integer
Dim iUBound As Integer
DataAdapter.SelectCommand = New System.Data.Odbc.OdbcCommand

With DataAdapter.SelectCommand
.CommandType = CommandType.StoredProcedure
.Connection = New System.Data.Odbc.OdbcConnection
.Connection.ConnectionTimeout = 15
.Connection.ConnectionString = "Driver={Microsoft Access Driver
(*.mdb)};" & _
"DBQ=" & tDBPath & tDBName & ";UID=;PWD=" & tDBPassword
End With
DataAdapter.InsertCommand = New System.Data.Odbc.OdbcCommand
With DataAdapter.InsertCommand
.CommandType = CommandType.StoredProcedure
.Connection = DataAdapter.SelectCommand.Connection
End With
DataAdapter.SelectCommand.Connection.Open()
iUBound = UBound(usrProcedures)

For i = 0 To iUBound

DataAdapter.SelectCommand.CommandText = "Execute " &
usrProcedures(i).tName & " " & usrProcedures(i).tParameters

If Me.bWriteToTraceFile Then Me.WriteToTextFile(" Executing... " &
usrProcedures(i).tName, System.AppDomain.CurrentDomain.BaseDirectory &
"..\TraceFiles\TraceODBC.txt", True)

DataAdapter.Fill(dsDataSet, usrProcedures(i).tTableName)

If Me.bWriteToTraceFile Then Me.WriteToTextFile(" Wrote to " &
usrProcedures(i).tTableName, System.AppDomain.CurrentDomain.BaseDirectory &
"..\TraceFiles\TraceODBC.txt", True)

Next
DataAdapter.SelectCommand.Connection.Close()
DataAdapter = Nothing

End Sub
'===========================================


Chuck Ritzke said:
Hi all,

I am getting an intermittant error after uploading a project from my
development machine. I click on a link which opens an aspx page that, upon
page load, reads a very small amount of data from an MS Access database,
using ODBC and a stored query. There is no problem on my development
machine. On the production server though, I get the intermittant error shown
below. If I click back and forth between the problem page and the linking
page, the error only occurs every 6th (or so) times I click on the link.
When I do get the error, the page works fine if I page back and click again,
or if I just re-load the page (until it happens again later). I read the DB
in other parts of the project and have not seen the problem anywhere else
yet.

This is my first .NET project and so I may be missing something obvious. Can
anybody tell me where I should look for this problem or what might be
causing it? I don't really understand how to use the stack info provided. Is
it some type of timing or "database not ready" thing that I need to handle?
(I've read lots of DBs in regular ASP and have had no problem like this).
Should I be trying to Catch this error somewhere (where?).

TIA,
Chuck
Server Error in '/HistoricGrowth' Application.
-------------------------------------------------------------------------- --
----

ERROR [22018] [Microsoft][ODBC Microsoft Access Driver] Unknown name
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [22018]
[Microsoft][ODBC Microsoft Access Driver] Unknown name

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[OdbcException: ERROR [22018] [Microsoft][ODBC Microsoft Access Driver]
Unknown name]
System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) +48System.Data.Odbc.OdbcCommand.System.Data.IDbCommand.ExecuteReader(CommandBeh
avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
+36
clsUtil_MyDB.MyDB.GetDataSet_ODBC(DataSet dsDataSet) +556
clsUtil_MyDB.MyDB.GetDataSet(DataSet dsDataSet) +22
HistoricGrowth.HistoricGrowth.InitializePageControls() +386
HistoricGrowth.HistoricGrowth.Page_Load(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731





-------------------------------------------------------------------------- --
 
C

Chuck Ritzke

I've found the problem (or at least testing has shown so thus far). My
procedure had arguments and I failed to put the arguments inside of single
quotes. Quoteless arguments in an MS Access stored query apparently work
inconsistently. Odd though that this causes no problems on my development
machine and just on the server.

Chuck

Chuck Ritzke said:
Hello again,

I narrowed down where the error occurs by writing to a trace file. Below is
my code that builds the data adapter and attempts to fill the dataset. When
the error occurs, it occurs the first time at the DATAADAPTER.FILL line in
the FOR NEXT loop. Again, the error occurs seemingly randomly. Anybody see
anything wrong that might cause the error to occur upon occasion and what I
should do to keep it from happening???

Thanks again,
Chuck

'===========================================
Private Sub GetDataSet_ODBC(ByVal dsDataSet As DataSet)

Dim DataAdapter As New System.Data.Odbc.OdbcDataAdapter
Dim i As Integer
Dim iUBound As Integer
DataAdapter.SelectCommand = New System.Data.Odbc.OdbcCommand

With DataAdapter.SelectCommand
.CommandType = CommandType.StoredProcedure
.Connection = New System.Data.Odbc.OdbcConnection
.Connection.ConnectionTimeout = 15
.Connection.ConnectionString = "Driver={Microsoft Access Driver
(*.mdb)};" & _
"DBQ=" & tDBPath & tDBName & ";UID=;PWD=" & tDBPassword
End With
DataAdapter.InsertCommand = New System.Data.Odbc.OdbcCommand
With DataAdapter.InsertCommand
.CommandType = CommandType.StoredProcedure
.Connection = DataAdapter.SelectCommand.Connection
End With
DataAdapter.SelectCommand.Connection.Open()
iUBound = UBound(usrProcedures)

For i = 0 To iUBound

DataAdapter.SelectCommand.CommandText = "Execute " &
usrProcedures(i).tName & " " & usrProcedures(i).tParameters

If Me.bWriteToTraceFile Then Me.WriteToTextFile(" Executing... " &
usrProcedures(i).tName, System.AppDomain.CurrentDomain.BaseDirectory &
"..\TraceFiles\TraceODBC.txt", True)

DataAdapter.Fill(dsDataSet, usrProcedures(i).tTableName)

If Me.bWriteToTraceFile Then Me.WriteToTextFile(" Wrote to " &
usrProcedures(i).tTableName, System.AppDomain.CurrentDomain.BaseDirectory &
"..\TraceFiles\TraceODBC.txt", True)

Next
DataAdapter.SelectCommand.Connection.Close()
DataAdapter = Nothing

End Sub
'===========================================


Chuck Ritzke said:
Hi all,

I am getting an intermittant error after uploading a project from my
development machine. I click on a link which opens an aspx page that, upon
page load, reads a very small amount of data from an MS Access database,
using ODBC and a stored query. There is no problem on my development
machine. On the production server though, I get the intermittant error shown
below. If I click back and forth between the problem page and the linking
page, the error only occurs every 6th (or so) times I click on the link.
When I do get the error, the page works fine if I page back and click again,
or if I just re-load the page (until it happens again later). I read the DB
in other parts of the project and have not seen the problem anywhere else
yet.

This is my first .NET project and so I may be missing something obvious. Can
anybody tell me where I should look for this problem or what might be
causing it? I don't really understand how to use the stack info
provided.
Is
it some type of timing or "database not ready" thing that I need to handle?
(I've read lots of DBs in regular ASP and have had no problem like this).
Should I be trying to Catch this error somewhere (where?).

TIA,
Chuck
Server Error in '/HistoricGrowth' Application.
--------------------------------------------------------------------------
--
----

ERROR [22018] [Microsoft][ODBC Microsoft Access Driver] Unknown name
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [22018]
[Microsoft][ODBC Microsoft Access Driver] Unknown name

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[OdbcException: ERROR [22018] [Microsoft][ODBC Microsoft Access Driver]
Unknown name]
System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) +48
System.Data.Odbc.OdbcCommand.System.Data.IDbCommand.ExecuteReader(CommandBeh
avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
+36
clsUtil_MyDB.MyDB.GetDataSet_ODBC(DataSet dsDataSet) +556
clsUtil_MyDB.MyDB.GetDataSet(DataSet dsDataSet) +22
HistoricGrowth.HistoricGrowth.InitializePageControls() +386
HistoricGrowth.HistoricGrowth.Page_Load(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top