Android Question Can a B4a app open a SQLite db on a PC

Discussion in 'Android Questions' started by baron, Aug 22, 2013.

  1. baron

    baron Member Licensed User

    I can update a SQLite db in File.DirRootExternal, but I want to do the same directly to a SQLite db on my pc.

    Using a wireless connection, with full read/write permissions on the folder and the SQLite db, the following code works perfectly, and finds the db in the Shared folder on my pc.

    Dim SMB1 As SMB
    SMB1.Initialize("SMB1")
    SMB1.SetCredentials("MyLogin","MyPassword","")
    SMB1.ListFiles("smb://MyPC/Shared/", "")

    However, the following attempt to open the db on the pc fails with the message:

    "android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database"

    Dim SQL1 As SQL
    Dim SMB1 As SMB
    SMB1.Initialize("SMB1")
    SMB1.SetCredentials("MyLogin","MyPassword","")
    SQL1.initialize("smb://HP/Shared/","MySQlite.db", False)

    Should this work, and then allow me to insert records ?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. baron

    baron Member Licensed User

    I've followed the instructions and this is the cmd box after starting the service:

    upload_2013-8-23_11-55-40.png

    Config.Properties

    DriverClass=org.sqlite.jdbc
    JdbcUrl=jdbc:sqlite:c:/Shared/M3Mobile.db

    User=mylogin
    Password=mypassword
    ServerPort=17178
    Debug=true


    I downloaded sqlite-jdbc-3.7.2.jar and copied it into RemoteDatabaseConnector/jdbc_driver

    When I test it in a browser (http://127.0.0.1:17178/?method=test), the following messages appear:

    upload_2013-8-23_12-1-25.png

    This is all on a Windows 7 64 bit system. I can't see any clues to why the driver is not found. Help anyone ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Should be
    org.sqlite.JDBC instead of
    org.sqlite.jdbc
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice