No database connection

2005-04-26
2013-04-26
  • Ron Sokoloski
    Ron Sokoloski
    2005-04-26

    I can't connect to my database using the windows port - I get an error box complaining that it can't connect.

    Any pointers on how to get to my own database?

     
    • Chris Ryan
      Chris Ryan
      2005-04-26

      It appears that the default connection parameters were messed up for the OpenRPT application. When you get the login screen check your options. Host should be "localhost" and port should be "5432" by default. In the distributed binary the host and port values were prepopulating with incorrect values. Once you have saved these changed on a computer it will remember them.

      If this does not help please let me know.

       
      • Mile
        Mile
        2005-06-21

        Hi,

        I used localhost, default port, myDbName and pswd which was blank as it is on my database, but I couldn't connect to database.
        The weird thing is that QSqlDatabase complains that it can't addDatabase ( "QPSQL7" ), and line below there is message that it has this driver, among two other.

        I have one qt application that has identical sequence.
        ...QSqlDB.addDatabase ( "QPSQL7" )
        ...QSqlDB.setHost ( )
        ..........
        and ...QSqlDB.open (). And it works.

        But somehow I can't connect with openRpt.

         
        • Chris Ryan
          Chris Ryan
          2005-06-24

          Are you using the precompiled binaries that were distributed are a version you have compiled yourself. If you are using the precompiled version it may be possible that the libpq library isn't being loaded for one reason or another.

          Chris Ryan

           
          • Mile
            Mile
            2005-06-24

            Hi Chris,

            I had sources. I used qmake and make, and compile procedure went well. What solution do you propose?

             
          • Mile
            Mile
            2005-07-27

            Hi,
            I still didn't solve that problem.
            You think that:"...libpq library distributed with OpenRPT is not loading because of a missing library support on your system. You can try to remove the one with OpenRPT or overwrite it with the one that is already on your system and see if that makes a difference..." will do?
            Can you tell me where is that lib in openrpt? I can't see it in Makefiles. My postgresql is under /usr/lib/postgres/. So, where to put which line?

            Thanks in advance,
            Mile

             
            • Chris Ryan
              Chris Ryan
              2005-07-27

              The suggestion of removng the libpq that came with OpenRPT that you are referencing was for someone who had downloaded the precompiled version. The sources don't include libpq as that is something you need to have already when you configure/compile qt and then build OpenRPT.

              I am at a loss as to why you are having problems since as you stated in one of your first posts that you have a similar application that does work correctly.

              Keeping with the thought that perhaps Qt is not able to load the libpq driver perhaps you should track through the libraries dependencies using ldd to see where it's looking for the libraries and that they are all in the locations as expected.

               
              • Mile
                Mile
                2005-08-22

                Hi Chris,

                Finally, I have OpenRPT up and running!
                But, I dont exactly know why -:( The trick for me was to modify LINKFLAGS for each Makefile in a way to add mt (threaded version?!?!? How come?) to lqt.
                So now it looks  -lqt-mt, and instead of libqt.3.so which I had, now I have libqt-mt.3.so (The one that my old program used).

                The program looks great, and its just what I needed. The only fault that I noticed is removing groups in detail section, but that is not important.

                I would like, once again, to thank you very much for the effort that You invested in helping me insofar.

                Best regards,
                Mile

                 
    • Sorry if the wrong place to post but it is the closest I could find.

      I just heard of OpenRPT on the PostgreSQL Advocacy list and am trying it on a WinXP system with a non-local database. ( There is a system dsn for the PostgreSQL database I'd like to connect to. )

      The documentation deals with OpenMFG database(s) which makes sense.

      Enough drivel:  how do I specify the System DSN to OpenRPT?

      TIA,
      Rod
      --

       
      • Chris Ryan
        Chris Ryan
        2005-04-27

        At this time the OpenRPT login screen only knows how to connect to PostgreSQL databases directly. If you wanted to use a DSN for ODBC the login screen would need to be changed to support ODBC connections. If you are using PostgreSQL though you can just specify the host, db and port for the direct connection.

        ODBC would probably be the first alternate connection method we would choose to implement if another one isn't contributed before then.

         
    • Thanks Ryan.  I did some more testing yesterday and went with a direct Pg connection.

      Now I have to figure out what the password is.  :-(

      The Pg account has existed a long time and all the Windows applications have the connection information stored.  I can't remeber off the top of my head what it is.  Time to get it into the Account Manager on my Palm!

      Again thanks for the help,
      Rod
      --

       
    • jo luso
      jo luso
      2005-07-14

      Hi all,

      I have the same connection problem...
      I didn't understand if Mile milvucko found the solution to it.
      When I try to connect to my DB the program shows me the following on the console...

      QSqlDatabase: QPSQL7 driver not loaded
      QSqlDatabase: available drivers:

      and it display also a window with this...

      ---------------------------------------------------------------------------------
      A connection to the specified OpenMFG cannot be made.
      This may be due to an incorrect Username and/or Password
      or that the OpenMFG Server in question cannot support anymore connections.
      Please verify your username and password and try again or wait until the specified OpenMFG Server is less busy.
      System Errore 'driver not loaded'
      ---------------------------------------------------------------------------------

      What's that OpenMFG Server?
      What's the driver not loaded?
      I'm using on my debian linux the precompiled OpenRPT.bin
      my pc have the PostgreSQL client to connect to another PostgreSQL server. It is accessible because I can connect using:
      psql mydb -h myserver -H myusername -W -p 5432

      Do I need any ODBC driver to connect to PostgreSQL?

      Thank you for any help.

      jo

       
      • Chris Ryan
        Chris Ryan
        2005-07-14

        I do not know the ultimate outcome was with milvucko. Since you are using the precompiled binaries on a non redhat system then most likely the libpq library distributed with OpenRPT is not loading because of a missing library support on your system. You can try to remove the one with OpenRPT or overwrite it with the one that is already on your system and see if that makes a difference.

        Chris

         
    • jo luso
      jo luso
      2005-07-15

      I follow your tip and I overwrite the libpq.so.3 with one already on my system, then I tried running OpenRPT but I cannot see any difference.
      Then I downloaded the sorces and I'm trying to compile it on my debian linux but make give me these errors:
      # make
      cd common && make -f Makefile
      make[1]: Entering directory `/dati/jose/openrpt-1.1.1beta-source/common'
      g++ -c -pipe -Wall -W -O2  -DMAKELIB -DQT_NO_DEBUG -I/usr/share/qt3/mkspecs/default -I. -I/usr/share/qt3/include -I. -Itmp/ -o tmp/parameter.o parameter.cpp
      In file included from parameter.cpp:23:
      parameter.h:26:24: qvaluelist.h: No such file or directory
      parameter.h:27:19: qpair.h: No such file or directory
      parameter.h:28:21: qstring.h: No such file or directory
      parameter.h:29:22: qvariant.h: No such file or directory
      In file included from parameter.cpp:23:
      parameter.h:39: error: parse error before `&' token
      parameter.h:45: error: ISO C++ forbids declaration of `QString' with no type
      parameter.h:45: error: `QString' declared as an `inline' field
      parameter.h:45: error: parse error before `(' token
      parameter.h:47: error: syntax error before `(' token
      parameter.h:51: error: 'QVariant' is used as a type, but is not defined as a
         type.
      parameter.h:52: error: parse error before `}' token
      parameter.h:54: error: parse error before `<' token
      parameter.h:58: error: parse error before `&' token
      parameter.h:59: error: parse error before `&' token
      parameter.h:60: error: parse error before `&' token
      parameter.h:67: error: parse error before `)' token
      parameter.h:68: error: parse error before `,' token
      parameter.h:69: error: parse error before `char'
      parameter.h:70: error: parse error before `&' token
      parameter.h:71: error: parse error before `&' token
      parameter.h:71: error: non-member function `bool inList(...)' cannot have `
         const' method qualifier
      parameter.h:72: error: parse error before `}' token
      parameter.cpp:29: error: parse error before `&' token
      parameter.cpp:32: error: ISO C++ forbids declaration of `_value' with no type
      parameter.cpp:32: error: `int Parameter::_value' is not a static member of `
         class Parameter'
      parameter.cpp:32: error: `pValue' was not declared in this scope
      parameter.cpp:33: error: parse error before `}' token
      parameter.cpp: In copy constructor `Parameter::Parameter(const Parameter&)':
      parameter.cpp:37: error: `_name' undeclared (first use this function)
      parameter.cpp:37: error: (Each undeclared identifier is reported only once for
         each function it appears in.)
      parameter.cpp:37: error: 'const class Parameter' has no member named '_name'
      parameter.cpp:38: error: `_value' undeclared (first use this function)
      parameter.cpp:38: error: 'const class Parameter' has no member named '_value'
      parameter.cpp: In member function `Parameter& Parameter::operator=(const
         Parameter&)':
      parameter.cpp:43: error: 'const class Parameter' has no member named '_name'
      parameter.cpp:44: error: 'const class Parameter' has no member named '_value'
      parameter.cpp: At global scope:
      parameter.cpp:50: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:50: error: syntax error before `{' token
      parameter.cpp:54: error: parse error before `&' token
      parameter.cpp:55: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:55: error: syntax error before `{' token
      parameter.cpp:59: error: parse error before `&' token
      parameter.cpp:60: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:60: error: syntax error before `{' token
      parameter.cpp:64: error: parse error before `&' token
      parameter.cpp:65: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:65: error: syntax error before `{' token
      parameter.cpp:70: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:70: error: syntax error before `{' token
      parameter.cpp:75: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:75: error: syntax error before `{' token
      parameter.cpp:80: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:80: error: syntax error before `{' token
      parameter.cpp:85: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:85: error: syntax error before `{' token
      parameter.cpp:90: error: cannot declare member function `ParameterList::append'
         within `Parameter'
      parameter.cpp:90: error: syntax error before `{' token
      parameter.cpp:94: error: syntax error before `::' token
      parameter.cpp:99: error: syntax error before `::' token
      parameter.cpp:107: error: syntax error before `::' token
      parameter.cpp:112: error: syntax error before `::' token
      parameter.cpp:114: error: `count' was not declared in this scope
      parameter.cpp:114: error: parse error before `;' token
      parameter.cpp:114: error: syntax error before `++' token
      parameter.cpp:131: error: parse error before `&' token
      parameter.cpp:132: error: cannot declare member function `ParameterList::inList
         ' within `Parameter'
      parameter.cpp:132: error: syntax error before `{' token
      parameter.cpp:133: error: `count' was not declared in this scope
      parameter.cpp:133: error: parse error before `;' token
      parameter.cpp:133: error: syntax error before `++' token
      make[1]: *** [tmp/parameter.o] Error 1
      make[1]: Leaving directory `/dati/jose/openrpt-1.1.1beta-source/common'
      make: *** [sub-common] Error 2
      root@jose:/dati/jose/openrpt-1.1.1beta-source#               

       
      • Chris Ryan
        Chris Ryan
        2005-07-15

        It looks like the compile can't find the Qt include files qvaluelist.h, qpair.h, qstring.h, and qvariant.h. All the other errors are stemming from those files being missing. If you can figure out why it's not finding them and fix that then you be good to go.

        Chris