Announcement

Collapse
No announcement yet.

SQL server connection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL server connection

    Hi all,
    I'm new here and trying out Setup Factory to make a prototype installer for our software. So far I've managed to do most of what we need, but I can't seem to find a way to do this:

    I want to locate a pre-existing ODBC connection to SQLserver and check whether my credentials allow me to log on. It seems possible to create a connection using ODBC.ConfigureDatasource() but I just want to check if it exists. Also, I want to check if it exists on some other server on the network (I know the server name in this case). Is it possible to do this?

    Secondly, is it possible to run a .executable and wait for it to finish within the installer. The plan is to use some program to hash a password that is entered in to the installer and copy it in a flat file (in the hashed form) that forms part of our config. Are there actions that can do this?

    Thanks in advance,
    John


  • #2
    I want to locate a pre-existing ODBC connection to SQLserver and check whether my credentials allow me to log on.
    This can be done with a plugin I developed. It can be found here.

    Secondly, is it possible to run a .executable and wait for it to finish within the installer.
    Set the WaitForReturn argument in File.Run() or Shell.Execute() to true, like so:

    Code:
    nRes = File.Run(path-to-executable, "arguments", "", SW_HIDE, true);
    Ulrich

    Comment


    • #3
      Hi Ulrich,
      Thank you so much, I shall give it a try!
      Cheers,
      John

      Comment


      • #4
        Hi Ulrich, I have finally managed to get my firm to buy the plug-in (!) IT's installed successfully and I'm looking for the documentation (basically parameter and return definitions) for the actions. Is this information available? The help in Setup Factory doesn't seem to have it (as it's a plug-in).

        Comment


        • #5
          If you are using my plugin, there a different ways you can get information about the actions, parameters and return values.
          1. Make sure you added the plugin to your project.
          2. Click About Plugin.
          3. Click Plugin Help.
          Click image for larger version

Name:	SCRN-2021-11-09-01.png
Views:	41
Size:	30.3 KB
ID:	307816

          This will open the help file (a HTML document) in your web browser.

          In the script editor, write the name of any action you need. You may use the New Action Wizard, shown in the post of the linked topic for this, or write the action directly.
          1. Double click the action you wrote, and the Action Properties dialog will be shown.
          2. Each parameter has a description, shown in this dialog.
          3. If the description is not enough (or you want to see a code sample), click the "Click here to learn more about this action" link.
          Click image for larger version

Name:	SCRN-2021-11-09-02.png
Views:	16
Size:	23.7 KB
ID:	307817

          Finally, you can also open the HTML located in the #SUFDIR#\Includes\Plugins\ODBC folder. I hope this helps.

          Ulrich

          Comment


          • #6
            Thanks Ulrich,
            is it possible to connect to a DB server on a separate machine, something like adding the Server Name to the 1st parameter of OpenDSNConnection
            eg. ODBC.OpenDSNConnection("//ServerID01/dsn_name", "username", "password", false, 1)
            ?
            If not, is there a different way to do this?
            Thanks in advance,
            John

            Comment


            • #7
              As far as I know, the DSN must be a local resource - but it can certainly can point to a remote server.
              https://docs.microsoft.com/en-us/cpp...svc-170#openex
              https://serverfault.com/questions/30...machine/720542

              Ulrich

              Comment

              Working...
              X