Code 80040E37 – Error: Table does not exist

Troubleshooting Code Error 80040E37 – Table does not exist

Error 80040E37 literally means there is something wrong with the LDAP domain database table.  However, in practical terms, most likely there is a syntax error in the LDAP:/domain line.

Introduction to Error Code 80040E37

This error code, 80040E37 occurs when you execute a VBScript.  You are probably using a WSH method to connect to LDAP.  My guess is that there is a mistake with the speech marks.

The Symptoms You GetTroubleshooting Code Error 80040E37 - Table does not exist

The script does not manipulate the Active Directory object as you had hoped, instead you get a Windows Script Host error message. The probably scenario is that you are trying to manipulate an LDAP object. 

The Cause of Code Error 80040E37

Incorrect reference to the domain in an LDAP command.  In this context ‘Table’ refers to a domain in line such as: LDAP://domain.

Variations:
One or more errors occurred during processing of command. Error 80040E14
Invalid Syntax. Error 800401E4

The Solution to Code Error 80040E37

Check the Line in your script that references the ‘Provider’.  If necessary, work back for previous LDAP occurrences.

Char 1: often lies! it just means that the whole line will not execute. In the case of runtime errors you can use this work around.  Add this line: On Error Resume Next

Recommended: Solarwinds’ Permissions Analyzer – Free Active Directory ToolFree Permissions Analyzer for Active Directory

I like thePermissions Analyzer because it enables me to see WHO has permissions to do WHAT at a glance.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, and takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free SolarWinds utility saves when you are troubleshooting authorization problems for user’s access to a resource.  Give this permissions monitor a try – it’s free!

Download SolarWinds’ Free Permissions Analyser – Active Directory Tool

Example of Script – Table Does Not Exist

Note the error is actually on line 15: it should be ‘LDAP://DC=CP,DC=Com’.  I could not get it to work with the strDomain variable; until Bruce M. kindly wrote in with the following correction.  If there is a message here it is pay careful attention to the single and double quotes.

Be advised that your error will be different, just apply the general principels and try different arrangements of speech marks.

Mistake line 15 & " ‘LDAP://’ & strDomain where objectClass=’printQueue’" 

Correct line 15 to read : & " ‘LDAP://" & strDomain & " ‘ where objectClass=’printQueue’ "

 VBScript for error codesI just could not get my script to work….. Until I mastered binding to LDAP.

‘ Get Domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDomain = objRootDSE.Get("DefaultNamingContext")

WScript.Echo strDomain ‘ This is Extra line Guy put in to test

Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "Select printerName, serverName from " _
& " ‘LDAP://’ & strDomain  where objectClass=’printQueue’"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Printer Name: " & objRecordSet.Fields("printerName").Value
Wscript.Echo "Server Name: " & objRecordSet.Fields("serverName").Value
objRecordSet.MoveNext
Loop

‘ End of Example 80040E37

 

See More Windows Update Error Codes 8004 Series

Error 80004005 Unspecified Error   •Error 80041021   •Error 80041001   •Error 80041002

Error 80048820   •Error 8004100E   •Review of SolarWinds Application Monitor (SAM)

Error 80040E14   • Error 80040E37   • Error 80041006   • Error 80041006

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor


Do you need additional help?

Give something back?

Would you like to help others?  If you have a good example of this error, then please email me, I will publish it with a credit to you:

If you like this page then please share it with your friends