Error Driver not loaded

39 views
Skip to first unread message

MOHANNAD ALDULAIMI

unread,
Jun 4, 2024, 4:11:02 PMJun 4
to The Ring Programming Language
Hello Mahmoud and all...

I'm using QT and my app use sqlite database but when i try to connect it , It can not load the driver ,here is the code:

load 'guilib.ring'

           oSqlDb = new qsqldatabase().addDatabase('QSQLITE')

           oSqlDb.setdatabasename('test.db')

           if ! oSqlDb.open()

                     ? 'Error '+oSqlDb.lastError().text()

                     od = oSqlDb.drivers()

                     for x=1 to od.size()

                            ? od.value(x)

                     next

              return

              ok

      oSqlQuery = new QSqlQuery()

new qapp{

      stylefusionblack()

      new qwidget() {

            new qpushbutton(self) {

                  setText('Test')

            }

      show()

      }

exec()

}


But when i run it , i get this output:

Error Driver not loaded 
QODBC
QODBC3
QPSQL
QPSQL7

==============================

Note: I have this file in %ring_dir%\sqldrivers:

qsqlite.dll

qsqlited.dll

qsqlodbc.dll

qsqlodbcd.dll

qsqlpsql.dll

qsqlpsqld.dll

=================================

So what should I do?


Thanks...

Mohannad




Ilir Liburn

unread,
Jun 4, 2024, 4:54:35 PMJun 4
to MOHANNAD ALDULAIMI, The Ring Programming Language
  Hello Mohannad,

just change your code to

           oSqlDb = new QSqlDatabase()
           see oSqlDB.isDriverAvailable('QSQLITE') + nl

           oSqlDb = oSqlDB.addDatabase('QSQLITE')
           oSqlDb.setdatabasename('test.db')

Greetings,
Ilir


--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/87bca744-6f3d-418c-8da0-97b01c5ded6an%40googlegroups.com.

Mahmoud Fayed

unread,
Jun 5, 2024, 2:06:42 AMJun 5
to The Ring Programming Language
Hello Mohannad, Ilir

If I will use SQLite, I prefer to using it through RingSQLite instead of RingQt

So, the database code could be used without Qt as a dependency

Related Applications:

Some applications that uses Qt for the GUI and RingSQLite for the database

Applications that uses Qt to use SQLite

Greetings,
Mahmoud

MOHANNAD ALDULAIMI

unread,
Jun 5, 2024, 5:54:01 AMJun 5
to The Ring Programming Language
Hello  Ilir, Mahmoud
Thank you for your help...
"If I will use SQLite, I prefer to using it through RingSQLite instead of RingQt">>
You are right depending on my testing it is not efficient as expected , So I changed into SQLite extension ...

Really I am thankful for your help...
best wishes...
Mohannad

Mahmoud Fayed

unread,
Jun 5, 2024, 8:46:26 AMJun 5
to The Ring Programming Language
Hello Mohannad

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages