Technical support This forum is closed.
Version 1.x > Technical support > Connection String View modes: 
User avatar
Member
Member
hklc198 - 1/9/2006 4:15:14 AM
   
Connection String
If I want to remote cmsdesk of my website at my computer, what is CMSConnectionString ?
Now, My CmsConnectionstring is <add key="CMSConnectionString" value="Data Source=DNVN;Initial Catalog=Test;User Id=sa;Password=abcd;Current Language=English;" /> and I meet a error when I insert a new entry : "An error occurred when saving data:Kentico.CMS.DataEngine.GeneralConnection.RunQueryObject: Query: INSERT INTO [CMS_Tintuc] ( [Tieude_ngan], [Tieude_dai], [Tomtat], [Noidung], [Kieutin], [Ngaygui], [NgayVN] ) VALUES ( @Tieude_ngan, @Tieude_dai, @Tomtat, @Noidung, @Kieutin, @Ngaygui, @NgayVN); SELECT @@identity AS [TintucID] caused exception: Kentico.CMS.DataProviderSQL.ExecuteQuery: Query: INSERT INTO [CMS_Tintuc] ( [Tieude_ngan], [Tieude_dai], [Tomtat], [Noidung], [Kieutin], [Ngaygui], [NgayVN] ) VALUES ( @Tieude_ngan, @Tieude_dai, @Tomtat, @Noidung, @Kieutin, @Ngaygui, @NgayVN); SELECT @@identity AS [TintucID] : caused exception: Invalid object name 'CMS_Tintuc'."

User avatar
Guest
admin - 1/9/2006 2:37:40 PM
   
Re: Connection String
Hello,

please check if the owner of the 'CMS_Tintuc' table is the same of the other tables (e.g. cms_tree). If not, you need to change the db owner using an SQL statement like this:

EXEC sp_changeobjectowner @objname, @newowner

Best Regards,

User avatar
Member
Member
hklc198 - 1/10/2006 3:17:00 AM
   
Re: Connection String
How to change newowner is dbo, I had used EXEC sp_changeobjectowner CMS_TinTuc, dbo but it is not correct

User avatar
Member
Member
Chameane - 1/11/2006 9:37:46 AM
   
Re: Connection String
Hi,

If you're using SQL Server,
You can use this in the Request Analyzer:

DECLARE @old sysname, @new sysname, @sql varchar(1000)

SELECT
@old = 'old_owner'
, @new = 'dbo'
, @sql = '
IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES
WHERE
QUOTENAME(TABLE_SCHEMA)+''.''+QUOTENAME(TABLE_NAME) = ''?''
AND TABLE_SCHEMA = ''' + @old + '''
)
EXECUTE sp_changeobjectowner ''?'', ''' + @new + ''''

EXECUTE sp_MSforeachtable @sql

You only have to change 'old_owner' to the owner you want to change...

Hope this can help you...

User avatar
Guest
admin - 1/12/2006 7:28:25 PM
   
Re: Connection String
Chameane, thank you for posting this useful script!

Regards,

User avatar
Member
Member
hklc198 - 1/13/2006 3:33:48 AM
   
Re: Connection String
thanks all for help

User avatar
Guest
admin - 1/12/2006 7:26:08 PM
   
Re: Connection String
Hello,

you need to specify the owner of the object. So if the current owner is "someone", you need to write the statement like this:

EXEC sp_changeobjectowner someone.CMS_TinTuc, dbo

Best Regards,