BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL DMO problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Dec 17, 2003 11:45 am    Post subject: SQL DMO problem Reply with quote



When I execute this code on a machine named PC1 it works with out problem:
var
SS: SqlServer;
begin
SS := CoSqlServer.Create; // --> works without problem
..
..
end;


However, when I try to create remote object on PC1, an exception is raised:
(the following code is executed on PC2)

var
SS: SqlServer;
begin
SS := CoSqlServer.CreateRemote('PC1'); // --> raises an exception "Class
not registered"
..
..
end;

DCOM is configured properly and tested with sample application
executed onb PC2, which creates WordApplication object on PC1.

I don't know what I'm missing.
Is it possible to create sqldmo object SqlServer on a remote machine ?
Thanks,



Back to top
Guest






PostPosted: Wed Dec 17, 2003 2:29 pm    Post subject: Re: SQL DMO problem Reply with quote



I solved the "class not registered" problem with hosting the objects from
sqldmo.dll in a
COM+ application server via Component services, but now the other problem
appears.

In fact, I'm trying to genere sqlscripts using sqldmo.
(the following code works normally when I'm creating objects locally
(.Create) and raises an EOleExceptionError
when I'm creating objects with CreateRemote)

procedure ...
var
SS: SqlServer;
Db: DataBase;
T: Transfer;
begin
SS := CoSqlServer.CreateRemote(EditServer.Text);
Db := CoDatabase.CreateRemote(EditServer.Text);
T := CoTransfer.CreateRemote(EditServer.Text);

SS.LoginSecure := CBTrusted.Checked;
SS.Connect(EditServer.Text, EditUserName.Text, EditPassword.Text); // this
line succesfully connects to sql server
Db := SS.Databases.Item(EditDB.Text, SS);
Caption := IntToStr(Db.size); // this line passes - gives correct value

Db.ScriptTransfer(T, 2, EditFileName.Text); // this line raises an
exception !!!!!!
end;

The last line raises the following error; [SQLDMO] The passed object is not
a SQLDMO object.

Any help?

Thanks


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.