all groups > sql server programming > november 2003 >
You're in the

sql server programming

group:

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database


[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database venkat
11/10/2003 11:14:57 PM
sql server programming:
Hi,

I am developing a module in VB with the following
functionality.

I have 3 database backup files which must be restored
in the sql server 2000 machine. Then I have to create a
sql server login and associate it to the databases as user
for them with dbo role.

I am using "restore database with recovery" statement
to restore the databases. Then SQL DMO objects for
creating sql login and associate it to the dbs. The
databases restored without any problem.

While executing the code snippet,

Set ObjDatabase = CreateObject("SQLDMO.Database")
Set ObjDatabase = objSQLServer.Databases(sDataBaseName,
sUserName)
Set oDbRole = ObjDatabase.DatabaseRoles("db_owner")
Set objuser = CreateObject("SQLDMO.User")
objuser.Login = sUserName
ObjDatabase.Users.Add objuser
oDbRole.AddMember (sUserName)

I received an error,

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
database 'databasename' version 534. Upgrade the database
to the latest version.

What could be the cause and resolution for this error?
Expecting a helpful reply.

Thanks,
Re: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database Ovidiu Craciun [MSFT]
11/11/2003 6:07:52 PM
hi Venkat,
a couple of questions I'd like to ask:
can you run
EXEC sp_dbcmptlevel YOUR_DATABASE
and tell me what is saying?

it looks like your database files are comming from SQL Server 2000 SP2 (534
version);
are u trying to restore the file to a SQL Server SP3 instance?

if you open QA can you shoot querries against that database?

--
Ovidiu Craciun [MS]
--//----
This posting is provided "AS IS" with no warranties, and confers no rights.
--//----
[quoted text, click to view]

AddThis Social Bookmark Button