2 Replies Latest reply: May 15, 2014 9:54 AM by JamVaz _ RSS

    OpenDataBase Method expamples

    JamVaz _

      Can some help me with some examples on how to use the OpenDatabase method. I have carefully examine the Programmer Guide, but still not gettin it correct.

       

      Or if any can share the correct syntax with a ODBC connection

       

      Is there another programmer resource with more, more, more examples.

       

      Thanks

      Any help is welcome

      James Vazquez

       

      [size="1"][ February 12, 2003, 11:02 AM: Message edited by: JamVaz ][/size]

        • OpenDataBase Method expamples
          Gareth Horton

          James

           

          Here are a few examples of the OpenDatabase method using SQL Server, with connection strings.

           

          You will need to read up on connection strings a little to understand what is going on.

           

          I am also assuming you know how to instantiate Monarch via OLE and so forth.

           

          [font="courier"]Open a DB using SQL Authentication with no sa password (note this is slightly different than when a password exists, in that ;pwd= is necessary after the database info)

           

           

          DBOpenStatus = oMonarch.Opendatabase("ODBC;DSN=SQLTestNoPassword;UID=sa;APP=Monarch for Windows;WSID=Workstation;DATABASE=test;pwd=","","dbo.appjobs","C:Program FilesMonarchModelsopendb.mod")

           

          Open a DB using Windows Authentication.

           

          DBOpenStatus = oMonarch.Opendatabase("ODBC;DSN=WindowsAuth;UID=winuser;APP=Monarch for Windows;WSID=Workstation;DATABASE=test;Trusted_Connection=Yes","","dbo.appjobs","C:Program FilesMonarchModelsopendb.mod")

           

          Open a DB using SQL Authentication with user ID of test and password of test

           

          DBOpenStatus = oMonarch.Opendatabase("ODBC;DSN=SQLTestWithPassword;UID=test;APP=Monarch for Windows;WSID=Workstation;DATABASE=test","test","dbo.appjobs","C:Program FilesMonarchModelsopendb.mod")  /font[/quote]I hope this gets you on your way.

           

          Gareth

           

          Originally posted by JamVaz:

          Can some help me with some examples on how to use the OpenDatabase method. I have carefully examine the Programmer Guide, but still not gettin it correct.

           

          Or if any can share the correct syntax with a ODBC connection

           

          Is there another programmer resource with more, more, more examples.

           

          Thanks

          Any help is welcome

          James Vazquez /b[/quote]

          • OpenDataBase Method expamples
            JamVaz _

            Thanks .... working great