Skip to content
  • 0 Votes
    14 Posts
    1k Views
    J
    @JonB I do not understand anything. Please could you give more informantion. Note : app release folder has [image: 4eb83936-1e08-43aa-adf2-7623432feb91.png] I solved the problem :) I add lib files from Postgresql to release folder [image: 9264bc86-4743-4f27-8db5-6abb3fe4b395.png] and it works. thank you @jsulm and @JonB
  • 0 Votes
    3 Posts
    567 Views
    J
    @jsulm While I was looking for piece of code to post, I actually found the problem in it. In some place, the connection wasn't passed to a query and it was associated with a "default" connection. @jsulm, thank you for the help!
  • Qt C++ FireBase Update Unique Value

    Unsolved General and Desktop qt5 c++ firebase database
    2
    0 Votes
    2 Posts
    550 Views
    SGaistS
    Hi, Not knowing the FreeBase API it's hard to answer. Do you have a link of it ? In any case, the worst case scenario would be to fetch the whole data, change the fields you want and then send again the whole data.
  • 0 Votes
    5 Posts
    815 Views
    Christian EhrlicherC
    The QSqlTableModel needs a real PK, yes.
  • 0 Votes
    16 Posts
    2k Views
    J
    @JonB sorry for that, insert into Dataset(AT) values(?): I know nothing about SQLite. Dataset(AT) is a (syntactically valid) table to insert into, is it? Yes, it is valid statement in sqlite. Also QSqlQuery::prepare() returns a bool for success/failure, which you should be checking. Returns true if the query is prepared successfully; otherwise returns false. Plus, you check QSqlDatabase::lastError() after QSqlQuery::exec() fails, but that says yes, I got error. like QSqlError("","",""); I checked again there was a problem in database but it solved thanks alot. Now, I'm able to insert data into database from QXlsx file.
  • 0 Votes
    5 Posts
    1k Views
    SGaistS
    Hi, What kind of popup are triggering the freeze ?
  • 0 Votes
    16 Posts
    2k Views
    JKSHJ
    @ELEMENTICY said in MySQL Connection failed,but i entered correct info of server: I tried it,it doesnt work. Can you help again xD You need to provide details of what you tried and what errors you got. Without the details, we can't help you.
  • QT MySQL Databese connect fail

    Solved General and Desktop mysql database qt5.9.2 c++ localhost
    4
    0 Votes
    4 Posts
    731 Views
    E
    @Christian-Ehrlicher yes,i just realize i forget to add sql to QT += core gui sql thanks for respone anyway
  • 0 Votes
    13 Posts
    2k Views
    jsulmJ
    @Piotrek102 said in QSQLITE app no connect to database after deploy: But what I sent you is not the main application file. It's part of the class I wrote It doesn't matter. What @JonB wrote applies.
  • 0 Votes
    7 Posts
    1k Views
    CharbyC
    Regarding your stack : Internet server with Windows : I really think Windows really have no added value in this area. Installing a DBMS like MySQL or MSSQL : you might be interested in NoSQL kind of database as you probably have limited relations between your data. I think some database also integrate out of the shelves a Rest or Curl API, at least that used to be the case with couchDb for instance No direct access to the database from outside for safety reasons Instead writing an API that runs on the server and allows indirect DB Access via predefined (HTTP?) Requests. if possible, aim for HTTPS right from the start. Regarding the authentification, for a pet project I have been relying on Wordpress to manage user management through REST, I am not sure tough it is actually a good solution but at least it is cheap and quite easy to set up.
  • SQLite database creation

    Solved General and Desktop sqllite mysql database qsqlite
    6
    0 Votes
    6 Posts
    1k Views
    Pablo J. RoginaP
    @Giggon said in SQLite database creation: Thread to be closed Please go and mark the post as solved. Thanks
  • 0 Votes
    2 Posts
    549 Views
    jsulmJ
    @moslehuddin You should be more precise when asking a question. What exactly are you asking? How to get data from a database? How to show it? Both? How to use QScrollArea? Qt SQL: https://doc-snapshots.qt.io/qt5-5.14/qtsql-index.html How to show the data: https://doc.qt.io/qt-5/qsqltablemodel.html and https://doc.qt.io/qt-5/qtableview.html How to use QScrollArea: https://doc.qt.io/qt-5/qscrollarea.html
  • 0 Votes
    24 Posts
    5k Views
    A
    @JSher said in Building QT with "windeployqt": not connect to database (ODBC): Its connecting to an OBDC entry in windows by the looks of it. I do not use ODBC much but the way I understand it is you have to make the entry on each machine....Thats why I use the standard mysql connector, then you do not. I could be off:) Ok thank you very much!!! I evaluate the transition to the mysql connector
  • 0 Votes
    14 Posts
    6k Views
    KroMignonK
    @davidesalvetti Hmm, I am not very confident in your solution. I would create a helper class to create/use right connection according to current thread. Something like this (it is just a skeleton, not sure it is working as it is): #include <QSqlDatabase> #include <QThread> class MyBDConnection { QString m_dbPath; QString m_dbName; Q_DISABLE_COPY(MyBDConnection) public: explicit MyBDConnection(const QString &sqlitePath, const QString &cnxName): m_dbPath(sqlitePath), m_dbName(cnxName) {} QSqlDatabase getDBConnection() { // Starting with Qt 5.11, sharing the same connection between threads is not allowed. // Use a dedicated connection for each thread requiring access to the database, // using the thread address as connection name. QSqlDatabase cnx; QString dbName = QStringLiteral("%1_%2").arg(m_dbName).arg(qintptr(QThread::currentThreadId()), 0, 16); if(QSqlDatabase::contains(dbName)) { cnx = QSqlDatabase::database(dbName); } else { cnx = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), dbName); cnx.setDatabaseName(m_dbPath); if (!cnx.isValid() || !cnx.open()) { qDebug() << "DB connection creation error!"; } } return cnx; } } And the only create on instance of this class and pass the pointer to each class which need connection to DB.
  • 0 Votes
    7 Posts
    3k Views
    Pl45m4P
    @Christian-Ehrlicher Hm ok... That's not what I wanted to hear :D Thank you anyway. I think, I will subclass QSqlQueryModel then and write functions to make the model writable...
  • cannot execute queries on a database

    Solved General and Desktop qtsql database
    8
    0 Votes
    8 Posts
    3k Views
    Christian EhrlicherC
    @EdwinSA said in cannot execute queries on a database: but the queries are not running And what does this mean? btw: QSqlQuery has some functions to get the error string - you should use them.
  • 0 Votes
    6 Posts
    2k Views
    SGaistS
    From the looks of it, you have to re-create the models when you change these settings.
  • 0 Votes
    10 Posts
    3k Views
    realhamidrezakpR
    What do you mean by modify the model ? i mean updating model , like a search window that needs to update model every time user change input. You can see how to handle QtSQL models and views in the QtSQL modules examples. i saw it, and figure out some of examples. but i need to read more about MVC in qt. thanks you.
  • 0 Votes
    10 Posts
    3k Views
    L
    @mrjj I have moved forward from calling my saved dates to receive the following: Read Value: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object] for key: dates (one for each date saved) when adding if(success) { console.log(JSON.stringify(value)) } I can also read the saved dates in the format of: [{"date":"2018-10-01T21:17:00.926"},{"date":"2018-10-02T12:00:00.000"},{"date":"2018-10-03T12:00:00.000"},{"date":"2018-10-06T12:00:00.000"},{"date":"2018-10-07T12:00:00.000"},{"date":"2018-10-08T12:00:00.000"}] now how would I determine these dates are saved in my calendar to add the marker? I have tried adding a property bool to the marker so the read value equals isMarked = true yet this either marks every date on the calendar or none at all depending on how I am working this?!? How would I convert the JSON string to individual date reads?