cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
menos16
Level 4

installscript and SQL COM object

Hello people....

i'm trying to work with installscript and SQL connections (and after search in this forum, found the following code; I believe that will resolve my problem), but can't explain the following behavior ...


function debug2(hMSI)
OBJECT oSQLServer;
STRING szSQLServer;
begin
set oSQLServer = CreateObject(SQLDMO.SQLServer);
if (oSQLServer == NOTHING) then
MessageBox ( "1", INFORMATION );
oSQLServer.LoginTimeout = 15;
else
MessageBox ( "2", INFORMATION );
endif;
MessageBox response( "3", INFORMATION );
set oSQLServer = NOTHING;
end;


these installscript code works fine in the machine w2003 server standart with IS2008 but not works in a clean windows XP, i can see the messagebox 1 but not the messagebox 3, an error appears in log file
debug2. Return value 3.
Info 2896.Executing action debug2 failed.


Why can not I initialize the object? what dependency am I ignoring?

regrats,
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

There could be an issue if the progid passed to CreateObject is not registered on a target machine. This would return no object.

In addition, if no object is created, the line of code immediately following the message box "1" will cause an exception, causing the installation to abort (there is no try/catch in the posted code to catch the exception).

Also note that you may want to use the IsObject function to determine if the object returned by CreateObject is valid instead of comparing to NOTHING.
0 Kudos
menos16
Level 4

joshstechnij wrote:
There could be an issue if the progid passed to CreateObject is not registered on a target machine. This would return no object.


Yes , I agree; I installed IS2008 evaluation in this machine (for debug) and the COM object began to works fine. so, I think, I need to register one or more DLL before.... which? I haven't got idea.
0 Kudos