We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


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

dyarosh asked
Medium Priority
Last Modified: 2010-05-19
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.
Watch Question

Most Valuable Expert 2014

Is the DB local to the web server or on the network?


The DB is local to the web server.
Most Valuable Expert 2014

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


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.

does Config get dropped or recreated at any stage ?


No.  It is a file that exists and has records added to it but is never deleted or recreated.
Most Valuable Expert 2014

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


Did the compact and repair and I still have the same problem.
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Most Valuable Expert 2014

And are you sure the code hasn't changed?


Below is a partial listing of the functions.asp file.

<%@ Language="VBSCRIPT"

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

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


' 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)
      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)
      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
      Response.Redirect("error.asp?id=" & Session("PackNo") & "&error=Open Config Error" & "&dbName=" & dbName)
end sub

Sub Database_Close(MyConn)
      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


' Open connection to Pack database
Call OpenDatabase(MyConn, adModeShareDenyNone)

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


I also checked that the path that is being returned for the database is correct.


I republished the files to make sure they are what I think they are and the problem still exists.

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") & "'"


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.
Most Valuable Expert 2014
Can you ask the hostin co. if that server is being pounded? It sounds more like a server problem than the code.


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.
Most Valuable Expert 2014

I'm going to ping some other experts and see if they have any ideas.


Greatly appreciated!
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?
it doesn't look right for a shared server starting with the drive name.

Did you call your web server people?


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.
Most Valuable Expert 2014

Glad to be of assistance. May all your days get brighter and brighter.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.