Deploying an application containing database
hi friends ,
i'm new to qt , so i don know how to deploy an application containing db
i'm using "QODBC" data base
Welcome to Qt Developer Network!
If you are new at Qt you should read Wiki-pages, here on DevNet and official Qt samples (you can find them in Qt SDK or Qt sources. There are many examples for each Qt module.
I recommend book "Programming With Qt":http://books.google.com/books/about/Programming_With_Qt.html?id=TjR2G7BXkO8C&redir_esc=y to read. It has many information. And I also recommend book (in russian) - Qt 4.5 Preffesional Programing on C++ (Max Shlee). But it's on russian)).
In general, you should learn into direction of QtSql module.
I will assume that you know how to build such an application. If not, you should heed tucnak's advice and dive into the docs, examples and some books.
Your question is not all that clear. You use the ODBC driver, but with what kind of database? Do you actually mean to distribute the database with your application, or do you just wonder how to distribute the driver and other relevant libraries?
i use Microsoft SQL Server db ..
i want to distribute data base with my application ..
i debugged my code in release mode ,attached needed dll's using dependancy walker ..i get proper results when i run exe in my machine
but when i run the same exe (with required dll's attached ) in any other machine where database is not installed i get only GUI part working .
AFAIK, Microsoft SQL server needs to be installed on the system. It's a big database system that requires far more than just copying some dll's. However, that is outside the scope Qt. Refer to MS SQL Server documentation on how to do this.
what if i use derby or some other small db .instead of ms sql .. ?
when i refered qt site (http://doc.qt.nokia.com/4.7-snapshot/deployment.html) it mentioned creating plugin so i was wondering do i hav to create plugin or something ?
The plugin is only a driver that allows you to connect to a database, not the database (-server) itself.
Perhaps you should investigate using a small embedded-type database like SqLite or MySql-Embedded. The first is trivial to use with Qt, while the latter is possible if you build the driver manually against the embedded version of MySql.
@andre thanks a lot .. :) now my code is working on all windows ..
but the thing is i have to creat DSN mannually in every system .. is there any way to do it automatically in QT code .. ?
That would be windows specific. Qt does not provide (direct) API for this specifically. You should search MSDN or something like that for ways to setup DSN's by software. If that requires registry access, you can use [[doc:QSettings]] for that. You can also use win32 API calls directly.
thank you andre :) it was really helpful .. :)
can we create dsn dynamically using qt code .. bcoz i'm using my sql server as database in my application and i create dsn mannually .. bt wen i distribute my app it will not find dsn .. unless i create dsn in every machine where i distribute my app ..
can anyone help me in solving my prob ??
[quote author="nil_sunil" date="1341839770"]can we create dsn dynamically using qt code .. bcoz i'm using my sql server as database in my application and i create dsn mannually .. bt wen i distribute my app it will not find dsn .. unless i create dsn in every machine where i distribute my app ..
can anyone help me in solving my prob ??[/quote]
Merged with your previous topic. Please don't start multiple topics on the same issue.