W Wosl Member Oct 25, 2025 #1 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: 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
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: 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
Erel B4X founder Staff member Licensed User Longtime User Oct 26, 2025 #2 It will not work. Android built-in SQLite engine doesn't support it. You can run jRDC2 on the remote server. Or copy the database locally and then access it. Upvote 0
It will not work. Android built-in SQLite engine doesn't support it. You can run jRDC2 on the remote server. Or copy the database locally and then access it.