Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

SQL scripts


7 replies to this topic

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 01 February 2006 - 23:25

I want to run an sql script (MySQL) as part of my installation. how do i insert and how to call? I added NewSqlConnection with login info choose MySQL db and version. Inserted the SQL script. selected a feature to associate the SQL script.

But still not understanding when and how they get called and how do i login? what are these function? OnSqlServerInitialize? and when do they get called.

Can someone explain me how does this work with some samples?

bhagelin

bhagelin
  • Members
  • 22 posts

Posted 01 February 2006 - 23:51

Look at the OnSQLServerInitialize function and you can see what subsequent functions get called. One of those it calls is the dialog SQLServerSelectLogin -- which is the dialog that prompts the user for the server name, user ID, and password. When the next button is clicked on that dialog, a connection is established with the server using the login credentials you supplied.

The SQLRTComponentInstall is the function that actually runs the scripts. It is called once for each component, and if that component contains scripts, they are run. Any errors are returned and displayed.

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 02 February 2006 - 16:27

OnSQLServerInitialize is called by OnFirstUIBefore. My project is ported from IS5.5 to 11.5 so the OnFirstUIBefore never gets called. what do I do?

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 02 February 2006 - 17:07

I get the below error

Browing or connecting for database servers requires MDAC be installed. Setup will now terminate.


pre-requisite feature is only availabe in Windows installer. how do I add this in installscript project.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 February 2006 - 18:03

If you want to install MDAC add the MDAC object to your project.

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 02 February 2006 - 19:10

I will add as object.

but I manually installed MDAC on my PC. still it complaints the same. why?

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 02 February 2006 - 19:18

i have a question.

i have a sql script associated with the feature. duing movedata, onSqlComponentInstalled, is when the script will be called. I have to call OnSQLServerInitialize before move data. but the MDAC will be installed duing movedata, then my OnSQLServerInitialise will still fail as no MDAC yet right?

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 03 February 2006 - 22:00

In my install, MySQL is one of the component. I have to install MySql along with other components, and update ImagePath and add MySQL service and start the mysql service. after that I have to run some .sql scripts for the MySQL. is this possible with IS sqlscripts view feature. it looks to me that OnSQLServerInitialise is called before move data which means, MySQL is wont be there in the system. OnSQLServerInitialise is only valid for the system that already has Some DBServer running? i am confused. OnSqlComponentInstalled is called during MoveData. but I have to run the scripts after installing MySQL and start service.

someone pl explain me if my problem can be solved with IS SQL Scripts feature or I have to do with diff. approach? thansk rama