Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Migrating from one SQL 2000 box to another
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  09:03:38  Show Profile
Hi,

My host recently moved my Snitz database from a shared SQL 2000 server onto my own dedicated machine. In theory I was supposed to change the connection string and I'd be up and running.

The database has been migrated and all the tables are there, everything looks identical - no data lost, no changed permissions, nothing. But when I point my connection string to the new database, it doesn't "see" it.

I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'FORUM_MEMBERS'.

/forum/inc_header.asp, line 222

I ran setup.asp and it said, "You need to create all the tables in the database before you can start using the forum."

I did this on a backup version of the database, just to see if it helped, and it created duplicates of tables that were already there. Names exactly the same, everything. Only empty, which isn't what I need.

I am stumped. Does anyone have an idea what could be going wrong here? My database has been moved a few times before and I've never encountered this particular problem. I'd appreciate any ideas. For right now I'm still running off the old box until I can get this figured out.

Clara<

Podge
Support Moderator

Ireland
3775 Posts

Posted - 19 December 2008 :  10:20:39  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Are you sure you are connecting to

1. The correct SQL Server
2. The correct database on the correct SQL Server

Did you change the i.p. address or hostname of the SQL server in the connection string to the reflect the new machine's i.p. address or hostname ?<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 December 2008 :  10:54:01  Show Profile  Send ruirib a Yahoo! Message
Probably you have a new user name and your tables are owned by the previous user name and so they can't be found. One way to solve it would be to change the ownership of the tables to the new user, or, even easier, to create a database user with the same user name used in the previous machine.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  11:46:50  Show Profile
Hi Rui and Podge - thank you both!

It would appear that I am definitely connecting to the correct SQL Server and the correct database on that server. I base this conclusion on the fact that when I was asked to run setup, it created duplicate tables in the very same database. Am I drawing the correct conclusion with that one?

In the connection string, I was told by my host to change the hostname to "localhost" because it is now on my machine, so that's what I've done.

The strange thing is that the usernames and permissions all transferred. I've been comparing the databases side by side, checking the table permissions, users, etc., and it appears that my tables are still owned by the same username. When I test my connection string using that username in the ODBC Data Source Administrator, it goes through without a hitch. But when I change that connection string in my config file, poof, Invalid object name 'FORUM_MEMBERS'

It's as if the forum sees my new database server, yes, but it doesn't acknowledge the existence of the 2GB forum database that's in there!<

Edited by - chp on 19 December 2008 11:56:39
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 December 2008 :  12:03:32  Show Profile  Send ruirib a Yahoo! Message
I admit that you're using Enterprise Manager, right? You also said there were two sets of tables, right? If so, can you tell me how are the table names being shown?
For example you have a dbo.FORUM_MEMBERS and a userx.FORUM_MEMBERs, or similar? If you can tell me what you had in the old database and in the new one, I can probably tell you how to overcome that.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 December 2008 :  12:13:09  Show Profile  Visit HuwR's Homepage
as rui said in a previous post, it is all down to the owner of the tables
there is a simple fix for this, and that is to change the strTableprefix values in config.asp and prepend the db owner to the table name, so that instead of FORUM_ it says dbo.FORUM_ or whatever the owner of the actual tables is.

might be worth asking your host how they migrated the database then I could give you a better idea of a proper fix, it could be that if they did a backup/restore that your user has orphaned rights to the db which need fixing.
<
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  12:14:26  Show Profile
Yes - I'm using Enterprise Manager.

I deleted the brand new empty duplicate tables that were created when I ran setup.asp, but I think you're on to something. If my memory serves me right, they were created by dbo and not by the username that created the original tables (and that's the one that still owns all the tables in the new db, and it's the username I use to log in).<
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  12:21:16  Show Profile
Hi - sorry I missed your post, HuwR.

First, the tables are all listed simply as "FORUM_...." with no dbo or userx (or my username) prefix. But under the "Owner" column, they are currently all owned by userx. When I ran setup.asp and it created the duplicate tables, it appears to me that they were *not* owned by the same userx, that they were by the dbo.

I tried changing the strTableprefix value so it said userx.FORUM_... and it still gave me an "invalid object name" error.

Edited to add: My host copied the database and then ran a restore to write all the tables. (Their language, not mine.)<

Edited by - chp on 19 December 2008 12:23:18
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 December 2008 :  12:21:41  Show Profile  Send ruirib a Yahoo! Message
Well, you may try Huw's suggested fix or even ask your host to assign the dbo role to your current DB user. Start by trying Huw's fix.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  12:26:29  Show Profile
Thank you Rui!

I changed the strTableprefix values in my config.asp so that instead of FORUM_ it says cparkes.FORUM (which is the owner of the tables). When I uploaded the new config.asp file and tried to pull up my site, it gave me an "invalid object name" error. Do I need to re-run setup.asp or anything to set the fix?<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 December 2008 :  12:30:17  Show Profile  Visit HuwR's Homepage
it sounds that your user is not actually the owner of the tables according to the new server, so you are suffering from what is called orphaned users, to fix it, open a query window in enterprise manager and type in the following and then run it.

EXEC sp_change_users_login 'Auto_Fix', 'userx'<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 December 2008 :  12:31:06  Show Profile  Send ruirib a Yahoo! Message
No, seems that won't work. I suggest that you try to change ownership of the tables to dbo. Gremlin posted code to do that here: http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=49166#266356

Copy the code and execute it in Enterprise Manager. It should fix your issue.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 December 2008 :  12:31:16  Show Profile  Visit HuwR's Homepage
where userx is your sql username <
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 December 2008 :  12:31:52  Show Profile  Visit HuwR's Homepage
just run the orphaned user fix I posted, that will sort it all out.<
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  12:40:26  Show Profile
Thank you! I tried HuwR's fix and it doesn't appear to have solved the problem. (Or maybe the database is so messed up at this point that I should just have them copy over a more recent version?) I'm off to check Gremlin's code. I shall report back as soon as I can. Thank you again, guys - it really helps to know I'm not alone here.<
Go to Top of Page

chp
Starting Member

16 Posts

Posted - 19 December 2008 :  12:48:30  Show Profile
Quick question: If I change ownership of the tables to dbo, do I need to update my connection string? I ask because I see no login information for dbo. (And I apologize in advance if I've just asked a really stupid question.)<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07