Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-16-2019, 02:04 AM   #1
kasmax
Newly Registered User
 
Join Date: Jun 2012
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
kasmax is on a distinguished road
Qt connection for andriod

Hi guys
I need some help i have been trying it for so long but failed to resolve it.
I have created a small application in Qt for andriod that works fine on desktop.
byt when i deploy it to andriod device the connection show its connected but fails to read or write from sqlite database.
i have tried all including qstandard paths, etc.
below is my connection code:
bool connOpen()
{
mydb=QSqlDatabase::addDatabase("QSQLITE");
//mydb.setDatabaseName("C:/Users/Kas/Documents/KFinance/KFinance.db");
mydb.setDatabaseName("KFinance.db");


if(!mydb.open())
{
qDebug()<<("Not Connected");
return false;
}
else
{
qDebug()<<("Connected");
return true;
}


}


it it possible that i copy the sqlite database manually to phone storage location or sd card and then what will be the code to connect it?


i will be thankkful if someone can modify my code above so that it can connect to sqlite db in say phone storage\MyTest dir.


many thanks for your help

kasmax is offline   Reply With Quote
Old 11-16-2019, 03:19 AM   #2
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,244
Thanks: 115
Thanked 3,075 Times in 2,793 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Qt connection for andriod

Kasmax

I've no idea what 'qt' is (QuickTime?) and this forum is primarily for Access which will not run on an Android device.

I expect that a specialist forum exists that would be more suitable for this question.
Good luck
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Old 11-16-2019, 03:24 AM   #3
vba_php
Software Engineer
 
vba_php's Avatar
 
Join Date: Oct 2019
Location: Iowa City, IA
Posts: 553
Thanks: 69
Thanked 60 Times in 60 Posts
vba_php is on a distinguished road
Re: Qt connection for andriod

kasmax,

this is where i post all of my android questions:

https://www.dreamincode.net/forums/f...e-development/

vba_php is offline   Reply With Quote
Old 11-16-2019, 06:13 AM   #4
plog
Banishment Pending
 
Join Date: May 2011
Posts: 9,418
Thanks: 11
Thanked 2,285 Times in 2,237 Posts
plog is a jewel in the rough plog is a jewel in the rough plog is a jewel in the rough
Re: Qt connection for andriod

Yeah, I would go elsewhere for real advice, but here's my near-ignorant advice:

Code:
mydb=QSqlDatabase::addDatabase("QSQLITE");
//mydb.setDatabaseName("C:/Users/Kas/Documents/KFinance/KFinance.db");
I've used QT and SqlLite on the raspberry pi, when I connect to a database that doesn't exist (because I mistyped the location or filename) it creates one in the exact location that I told it to look. That may be whats happening with you.

It doesn't find your database so it creates and connects to a new blank database. So, its shows connected, but when you perform a specific task (query specific table) it fails because that new blank database doesn't have any tables.

So, I would check your path to make sure its correct for android.

plog is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Andriod App ootkhopdi The Watercooler 3 11-08-2017 05:11 AM
Way to detect when ADODB.Connection has lost its connection? mdlueck Modules & VBA 7 10-26-2012 07:00 AM
Secure connection using ODBC connection latex88 General 1 08-19-2012 08:14 AM
dsn less connection spinkung Modules & VBA 3 10-03-2011 09:34 AM
How to Establish the connection between Ms-Access2000 & Oracle using DAO Connection? gksenthilkumar General 1 09-26-2005 08:51 PM




All times are GMT -8. The time now is 08:29 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World