Re: Intermittant Server Error reading an MS Access DB

From: Chuck Ritzke (CHUCK)
Date: 04/26/04


Date: Mon, 26 Apr 2004 09:38:17 -0500

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:%23hDhXqbKEHA.1132@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:eizWwnIKEHA.2680@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(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
> >
> >
> >
> >
> >
>
> --------------------------------------------------------------------------
> --
> > ----
> >
> > Version Information: Microsoft .NET Framework Version:1.1.4322.573;
> ASP.NET
> > Version:1.1.4322.573
> >
> >
>
>



Relevant Pages

  • Please help !!!! Server Error in Application !! Object variable or
    ... We have hosted an asp.net application in a windows 2003 server machine. ... Dim OnlineConnection As New OnlineConnection ... An unhandled exception occurred during the execution of the ... Please review the stack trace for more information about ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: mscorlib error
    ... Have you looked at the stack trace? ... why would you throw an exception ... Dim FileToDelete As String ... Dim iResult As DialogResult _ ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Thanks
    ... Chuck W wrote: ... I created the query called tmpSelectProducts ... >>> highlights the Dim qdf as DAO.QueryDef line. ... >>> Dim StrWhere As String ...
    (microsoft.public.access.forms)
  • Re: DropDownList has SelectedValue which in invalid
    ... resulting in the invalid SelectedValue error. ... Dim ddl1 As DropDownList = CType, ... From your description you want to avoid getting the exception: ... Microsoft Online Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How is it possible ...
    ... Dim myExportFile As String = CType, ... Catch ex As Exception ... 'Throw exc ... Private Sub Page_Init(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)