• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1129
  • Last Modified:

SQL State Error 3078 - Can't open my database - URGENT 500 Points

I have a web application that uses a MS Access database.  When you go to the webpage, it opens the Config database and checks the Config Table for an id that is provided on the query string.  Everything has been working fine until this morning when I'm getting the following error:

Microsoft Jet database engine cannot find the input table or query 'Config'.  Make sure it exists and that its name is spelled correctly.
Help Context: 5003011
Native Error: -524420377
Error: -2147217865
Sql State: 3078

I have not made any updates to the web application in months.  What is really frustrating is that if I enter the URL again it works fine.  If I close my browser and try again I get the error.  Here is the link that you can try to see what I mean:

www.pocopsonpack231.org  (this url redirects to another url)

To recreate the problem, open a browser, enter www.pocopsonpack231.org.  You will get an error page.  Go up to the address bar and enter www.pocopsonpack231.org again and you will get the correct webpage.

I copied the database to my local machine and ran it from my local website and it works fine so I'm not sure that it is a corrupted database.  I also stopped and restarted my website (not the server though).  Any help would be greatly appreciated since I have many clients that are using this site.
0
dyarosh
Asked:
dyarosh
  • 11
  • 7
  • 2
  • +2
3 Solutions
 
Jim P.Commented:
Is the DB local to the web server or on the network?
0
 
dyaroshAuthor Commented:
The DB is local to the web server.
0
 
Jim P.Commented:
I was thinking network speed.  

Is the server CPU and utilization okay?
Have you done a compact repair anyway?
Can you try re-installing the JET?
-----------------------------------------------------------------------------------------
Error Encountered:

Error ID: 2

Error Type: Configuration Error

dbName: C:\webspace\resadmin\dyarosh\packwebsites.org\www\config.mdb

Description: The Microsoft Jet database engine cannot find the input table or query 'Config'. Make sure it exists and that its name is spelled correctly.
Help context: 5003011
Help file:
Native error: -524420377
Error number: -2147217865
Error source: Microsoft JET Database Engine
SQL state: 3078


Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Database_Close'

/error.asp, line 38
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
dyaroshAuthor Commented:
I don't have access to the web server to check the CPU Utilization.  I pay a web hosting company to host the website.

What is the compact repair that you refer to?  Is it done on the Access Database and if so how?

I am going to ask the web server provider to reboot the server to see if that will resolve the problem.  If not I'll ask them to reinstall the JET.
0
 
Jonathan KellyCommented:
does Config get dropped or recreated at any stage ?
0
 
dyaroshAuthor Commented:
No.  It is a file that exists and has records added to it but is never deleted or recreated.
0
 
Jim P.Commented:
You can use either jetcomp from MS at  http://support.microsoft.com/kb/295334/en-us


Or open the database in access and do Tools --> Database Utilities --> compact and Repair
0
 
dyaroshAuthor Commented:
Did the compact and repair and I still have the same problem.
0
 
Jonathan KellyCommented:
sounds like the server is too busy to service the connection or the database is open elsewhere exclusively.

can you post the code that connects to Config

0
 
Jim P.Commented:
And are you sure the code hasn't changed?
0
 
dyaroshAuthor Commented:
Below is a partial listing of the functions.asp file.

<%@ Language="VBSCRIPT"
      ENABLESESSIONSTATE = True %>

<!--#includes file="adovbs.inc"-->
<%
sub OnStart

Dim MyConn, MyConfig, ConnStr, dbPath, dbName, rs

ON ERROR RESUME NEXT

' Check if Session ID and Request ID are different
if Session("PackID") <> Request.QueryString("id") then
      ' Check if id exists in configuration file
      Call OpenConfigDatabase(MyConfig, adModeShareDenyNone)
      
*** This is where the error is coming from based on the fact that the error says Configuration Error.  Also because the error id is 2 I know that Request.QueryString("id") is valid ****                
                ConnStr="select Directory, PackNo from Config where id=" & Request.QueryString("id")
      set rs=MyConfig.Execute (ConnStr)
      if rs.EOF then            ' id not found in configuration file
            Response.Redirect ("error.asp?id=" & Request.QueryString("id") & "&error=Configuration Error" & "&dbName=" & dbName)
      else
            Session("PackID")=Request.QueryString("id")
            Session("PackDir")=rs("Directory")
            Session("PackNo")=rs("PackNo")
      end if

      Call Database_Close(MyConfig)

      ' Get the welcome message from the database
      Call OpenDatabase(MyConn, adModeShareDenyNone)
      set rs=MyConn.Execute ("select * from PackConfig")
      if rs.EOF then            ' id not found in configuration file
            Response.Redirect ("error.asp?id=" & Request.QueryString("id") & "&error=Directory Error" & "&dbName=" & dbName)
      else
            Session("Welcome")=rs("Welcome")
            Session("Council")=rs("Council")
            Session("CharteredOrg")=rs("CharteredOrg")
            Session("CharterOrgAddr1")=rs("Address1")
            Session("CharterOrgAddr2")=rs("Address2")
            Session("CharterOrgCity")=rs("CityStateZip")
            Session("CharterOrgPhone")=rs("Phone")
            Session("PackDues")=rs("Dues")
            Session("PackDuesBoysLife")=rs("DueswithBoysLife")
            Session("BeginMonth")=rs("MonthStart")
            Session("LoggedIn")="0"
            Session("Errors")=0
            Session("Den")=""
            Session("WebPage")=""
      end if
      
      Call Database_Close(MyConn)
end if
end sub

sub OpenConfigDatabase(MyConfig, mode)

      Dim dbPath, dbName

'      On Error GoTo ErrHandler
      Set MyConfig = Server.CreateObject("ADODB.Connection")

      dbPath = Request.ServerVariables("APPL_PHYSICAL_PATH")
      dbName = dbPath & "config.mdb"
      MyConfig.Provider = "Microsoft.Jet.OLEDB.4.0"
      MyConfig.Mode = mode
      MyConfig.ConnectionTimeout = 60
      MyConfig.Open dbName
      
      Exit sub
      
ErrHandler:
      Response.Redirect("error.asp?id=" & Session("PackNo") & "&error=Open Config Error" & "&dbName=" & dbName)
end sub

Sub Database_Close(MyConn)
      MyConn.Close()
      Set MyConn = Nothing
End Sub

Here is a copy of the code that is in the packweb.asp file which is what is being called when the url is entered:  (i.e. www.packwebsites.org/packweb.asp?id=2)

<!--#includes file="functions.asp"-->
<%
Dim MyConn

OnStart()

' Open connection to Pack database
Call OpenDatabase(MyConn, adModeShareDenyNone)
%>
<html>

Here is a partial listing of the adovbs.inc file:

'---- ConnectModeEnum Values ----
Const adModeUnknown = 0
Const adModeRead = 1
Const adModeWrite = 2
Const adModeReadWrite = 3
Const adModeShareDenyRead = 4
Const adModeShareDenyWrite = 8
Const adModeShareExclusive = &Hc
Const adModeShareDenyNone = &H10
Const adModeRecursive = &H400000
0
 
dyaroshAuthor Commented:
I also checked that the path that is being returned for the database is correct.
0
 
dyaroshAuthor Commented:
I republished the files to make sure they are what I think they are and the problem still exists.
0
 
metapherCommented:
Hi dyarosh,

can it be, that you need quotes for your id-paramater in the query? Like...

ConnStr="select Directory, PackNo from Config where id='" & Request.QueryString("id") & "'"
0
 
dyaroshAuthor Commented:
The database field is numeric.  Keep in mind that this has been working for over 1 year and was working fine last night.  It was this morning when I noticed the problem.  The web hosting company says they did not perform any updates on the server.
0
 
Jim P.Commented:
Can you ask the hostin co. if that server is being pounded? It sounds more like a server problem than the code.
0
 
dyaroshAuthor Commented:
I agree it sounds like a server problem.  I checked other sites that I have hosted with this company and I can get to them without any problem.  I even tried a site that uses a MS Access database and it seems to work fine (of course it is not the same database as the site that is having the problem).  I am trying to find out from the web hosting company if my other sites reside on the same server as the site that is having the problem.  If they do, do you have any other thoughts.  I'm afraid the web hosting company is going to come back and say the problem is on my end.  

The premise of the site is that users have their own url that is redirected to www.packwebsites.org/packweb.asp?id=xxx where xxx is a number that corresponds to a value in the config file that is being opened and generating the error.  The id in the config file tells the software which directory the url's files reside in and it uses that information to make the site unique to each pack.

Here are the stats that I can get on the site:

Allocated Disk Space for Plan : 100.00 MB
Utilized Disk Space by Plan : 49.31 MB
Disk Space Left : 50.69 MB

Allocated Bandwidth for Plan : 1.95 GB
Utilized Bandwidth by Plan : 1.08 MB
Bandwidth Left : 1.95 GB

As you can see, I have disk space available and I'm not close to using my available bandwidth.
0
 
Jim P.Commented:
I'm going to ping some other experts and see if they have any ideas.
0
 
dyaroshAuthor Commented:
Greatly appreciated!
0
 
thenelsonCommented:
I don't think it is a problem with your database, I believe it is a problem with the web server or the redirection.  Is this the path and name of YOUR database?
C:\webspace\resadmin\dyarosh\packwebsites.org\www\config.mdb
it doesn't look right for a shared server starting with the drive name.

Did you call your web server people?
0
 
dyaroshAuthor Commented:
I would like to thank everyone who helped me on this.  The web hosting company rebooted the server and the problem is solved for now.  The admin thinks it is a JET problem and is looking into it further.  I awarded the points based on the amount of responses each person gave me.  I hope you think it was fair.
0
 
Jim P.Commented:
Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 11
  • 7
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now