Dear all,
I've a SQLite database located on a NAS in a SMB2 share. Using jcifs-ng I can see the data base and list with its attributes (e.g. size, date). Now I try to open this data base (in Starter.bas) but I receive an exception.
Here is the code snippet:
which ends up with the following exception message:
The error message is that DB path doesn't exist. Obviously, the double slashes "//" are disappearing: smb://192.168.178.1/ --> smb:/192.168.178.1/. So far the message is correct because of a missing slash "/".
Questions:
1. How can I avoid the behavior that double slashes are converted to a single slash (e.g using an escape character)?
2. Generally: is it possible to open in B4A a SQLite DB located on a SMB2 share?
Any idea is appreciated.
Wosl
I've a SQLite database located on a NAS in a SMB2 share. Using jcifs-ng I can see the data base and list with its attributes (e.g. size, date). Now I try to open this data base (in Starter.bas) but I receive an exception.
Here is the code snippet:
B4X:
Private SQL1 As SQL
Log ("DB location: '" & cPath & "'")
Log ("DB name: '" & SolarEdgeDBName & "'")
SQL1.Initialize(cPath, SolarEdgeDBName, False)
Log ("DB is initialized: " & SQL1.IsInitialized)
which ends up with the following exception message:
B4X:
DB location: 'smb://192.168.178.1/fritz.nas/HomeNetNAS/TestDB'
DB name: 'solaredge_modbus_test.db'
Error occurred on line: 122 (Starter)
android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database 'smb:/192.168.178.1/fritz.nas/HomeNetNAS/TestDB/solaredge_modbus_test.db' with flags 0x10: Directory smb:/192.168.178.1/fritz.nas/HomeNetNAS/TestDB doesn't exist
The error message is that DB path doesn't exist. Obviously, the double slashes "//" are disappearing: smb://192.168.178.1/ --> smb:/192.168.178.1/. So far the message is correct because of a missing slash "/".
Questions:
1. How can I avoid the behavior that double slashes are converted to a single slash (e.g using an escape character)?
2. Generally: is it possible to open in B4A a SQLite DB located on a SMB2 share?
Any idea is appreciated.
Wosl