SQL Error: HY024

Does anyone know what this error means: Error: [Microsoft][ODBC SQL Server Driver]Database is invalid or cannot be accessed. State ID: HY024

It comes when I’m trying to upload a new license file to the server from the Attain 3.60 client.

I haver seen an error like this, when i accessed a database, in process og making a backup

sounds strange…at least to ver.3.10A Navision has stored its license file into the ‘master’ or ‘msdb’ database. So I suppose its something wrong with one of them. What Microsoft says on this state is: “HY024 - Returned for an invalid attribute value.” brgds, Nikola Nyagolov

The license is stored in table [$ndo$srvproperty] in the master database. Can you run the Client Monitor before performing the upload. It will allow you to see the last statement issued before getting the error. Otherwise, have you tried deleting the above table and opening your database again. You will be prompted for a license file to upload before opening your database. Does the error still occur then?

but in 3.60 the license is stored for each database, not for the whole server //Lars

I think that Roberts idea should work fine. Last executed operation should give a good idea what happened, even with the 3.60 client.

Lars, in 3.60 the license is stored in the database only if you choose to do so, otherwise it continues to be stored server-wide, being the default setting for a new database. Not everyone is interested in a per-database license.

OK. Thanks for that info. That’s good. Otherwise it would cost c/shell’s to have a test database.

An update 5 years later…

This can occur when the user attempting to perform the Upload of the license is not a member of db_owner in the NAV database.

The connected user must both be a db_owner, and also have UPDATE permission to the [$ndo$srvproperty] table in the master database, in order to upload a server license. Of course, any higher permissions is ok too, such as sysadmin.

I have a question about this…Dean said previously that “Not everyone is interested in a per-database license.”

What is the alternative if a second database is needed?

For the SQL Server option, the standard license is a license per SQL Server instance. The license is stored in a table in the Master database, and is used for all NAV databases on that server. The license per database is a separate granule.

Is it a common practice to have multiple databases on one server running under the common license?

Sure, a production, a test and a development database for instance, production and a demo database, in a partner case you’d have a copy of a number of customer databases on the same server.

Having now re-read this thread yet again I would like to add what I think is the most common reason for Erik’s original question.

Every time I see this error it is due to the database being set in “single-user” mode, and there is already 1 connection using the database. All other connections, no matter what they are trying to do, will see this rather cryptic error from SQL Server.

If you cannot identify the application occupying the single connection in order to close it (sometimes that’s hard if it is a service doing it) then do a SQL Server restart, followed by disabling the single-user setting of the database either in NAV or in Management Studio.

I would be interested if anyone has seen other reasons for this error than this.

I just happened to be working in a single user database and thought I’d try that out, and indeed, I get the message:

Microsoft Dynamics NAV

The following ODBC error occurred:

Error: [Microsoft][ODBC SQL Server Driver]Database is invalid or cannot be accessed
State ID: HY024


Hi Dean,

Thank you. Even though this is over 6 years ago now, then I do know that the database was not in “single-user” mode. But I do know that there was other users online, also that there was more than one user online. But that’s all.


Super Thx…Just couldn’t understand why I wasn’t able to create new Windows User for my new Romainian NAV Database! It was in Single User-mode because I had to change the sorting…

You just saved the day!!!

It’s fantastic how good people contributing to such forums can help “the rest of the world”. Thank you again!!!