PDA

View Full Version : I'm getting a "SQLRTInitialize: undefined identifier" error



jr2004
06-20-2005, 04:50 PM
I'm using InstallScript MSI Project and trying to call OnSQLServerInitialize and SQLRTInitialize from the script. However, when I call OnSQLServerInitialize and SQLRTInitialize, I'm geting the following errors:

OnSQLServerInitialize: undefined identifer
SQLRTInitialize: undefined identifier

Here's the code snippet:

nResult = OnSQLServerInitialize(nResult);
SQLRTInitialize( SUPPORTDIR ^ "SQLRT.ini");

I already added the SQLRT.obl and SQLCONV.obl into the libraries path. But I'm still getting the errors above.

Thanks in advance.

hidenori
06-21-2005, 01:51 AM
The OnSQLServerInitialize event and SQLRTInitialize function are only supported for the InstallScript project type. In an InstallScript MSI project, the OnSQLLogin event is equivalent to the OnSQLServerInitialize event.

In order to call that event, you need to have at least one SQL script in the SQL Scripts view. It automatically adds ISSQLSRV.DLL to the Binary table which is used to validate connections, browse SQL Servers, and run SQL scripts.

Hope this helps.

jr2004
06-21-2005, 10:57 AM
Is it possible to not show the SQL Login dialog box since I already have my own custom dialog box which gets the user/pwd info? Also, what is the equivalent of SQLRTConnect2 on InstallScript MSI project since I want to programatically verify if the user/pwd/server is valid? How will I run SQL scripts?

Thanks very much for all your help on this.

hidenori
06-21-2005, 02:38 PM
The SQLRTServerValidate function is the equivalent of SQLRTConnect2 . If you don't want to use our default SQLLogin dialog, show the OnSQLLogin code in your InstallScript by clicking Before Move Data - OnSQLLogin from the dropdown list on the top of the InstallScript editor. SQLServerSelectLogin is the function which displays the built-in SQLLogin dialog. You want to comment it out and insert your code that displays your custom dialog.

In an InstallScript MSI project, the scripts that are added to the SQL Scripts view are executed by the custom actions, ISSQLServerInstall and ISSQLServerUninstall.