By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Intermittant Server Error reading an MS Access DB

P: n/a
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(Handle Ref hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(Command Behavior behavior) +48

System.Data.Odbc.OdbcCommand.System.Data.IDbComman d.ExecuteReader(CommandBeh
avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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.InitializePageContro ls() +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

----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <CHUCK AT MYACTUARY DOT COM> wrote in message
news:ei**************@TK2MSFTNGP11.phx.gbl...
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(Handle Ref hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(Command Behavior behavior) +48
System.Data.Odbc.OdbcCommand.System.Data.IDbComman d.ExecuteReader(CommandBeh avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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.InitializePageContro ls() +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

-------------------------------------------------------------------------- -- ----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Nov 18 '05 #2

P: n/a
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" <CHUCK AT MYACTUARY DOT COM> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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" <CHUCK AT MYACTUARY DOT COM> wrote in message
news:ei**************@TK2MSFTNGP11.phx.gbl...
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(Handle Ref hrHandle,
SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior
behavior, String method) +1189
System.Data.Odbc.OdbcCommand.ExecuteReader(Command Behavior behavior)

+48

System.Data.Odbc.OdbcCommand.System.Data.IDbComman d.ExecuteReader(CommandBeh
avior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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.InitializePageContro ls() +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



--------------------------------------------------------------------------
--
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573;

ASP.NET
Version:1.1.4322.573


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.