Can SQLite be accessed from another machine? - sqlite

Is it possible to access a SQLite database running on a WP8 app from a Windows 8/Store/"Metro" app?
If yes, how - is there any trick to it? Is it easy, tricky, or impossible?
If impossible, is it possible with any other DB? AFAIK, SQLite is the only DB that can be used with the new Windows Store style sandboxed apps.

Have a look at this article. It explains that:
sqlite is only used for storing data locally (i.e. cache something from a remote data source)
you cannot connect to remote databases because that involves distributing your database connection string (i.e. username and password) to potentially millions of users
the correct way to provide data to your app is through some sort of service. Think about the different APIs major website have now.
So to answer your question: no, this is a bad idea.

Related

Access Databases and ASP.NET?

I apologize if this question is not appropriate; however, I personally do not have Microsoft Access installed on my machine, so I am not able to test it first hand.
To my understanding, an Access database is a local database that is stored on a personal machine rather than a remote server. I am in the planning phase of a project will involve two basic interfaces - one for a regular user and another for the admin who will be running reports and the like. Personally, I would rather just use either an SQL Server or MySQL database all the way and just write some stored procedures or whatever is necessary to do the reporting.
However, the end administrative user may want to use Access. With this is mind, I am curious how I should approach the problem. As I stated earlier, I am not familiar with Access databases; however, I do not believe it is realistic to host one on a server and allow many users to access this database through a web interface. Is this correct or not? If it is possible, what is the general procedure for setting such an application up?
If not, what are my alternatives? Is there an easy way to sync a remote SQL server or MySQL database with Access database hosted on one's PC?
Thanks much.
I do not believe it is realistic to host one on a server and allow
many users to access this database through a web interface. Is this
correct or not?
You have a number of options including hosting the access database in a network folder.
https://support.office.com/en-us/article/Ways-to-share-an-Access-desktop-database-03822632-da43-4d8f-ba2a-68da245a0446
See also "Using Access Data on an ASP.NET Web Page"
https://msdn.microsoft.com/en-us/library/445z2s49(v=vs.100).aspx

Windows Phone local storage with Azure cloud sync'ing

I'm writing a WP8 app that needs local storage on the phone itself (due to poor internet connectivity) but also the ability to push to the Azure cloud when there is internet available.
I'm just looking to see what everyone thinks is the best method for local storage?
SQLite? JSON string saved to local storage? Or maybe I'm missing something. Ideally I'd like something that mirrored/used the classes I need that represent the tables in the cloud.
Hope this makes sense.
Cheers
You can use the local database for Windows Phone, which allows you to mark up your classes with attributes to define the tables, columns, relationships, etc. You can use SQLite, but I prefer this approach since it's straightforward and easy to implement.
Here's the information on MSDN about it: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202860(v=vs.105).aspx
And this walk through example: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202860(v=vs.105).aspx

SQLite db protection using events/mutex

I have two windows applications which will be accessing same database(stored in a hard disk). Only one of these two application is performing both read/write operations in this db while the second one only performs read operations. Do I need mutex/events to protect my db while both applications are accessing it? I was reading FAQ of SQLite which says that I might not need any resource protection, SQLite has in-built feature..

asp.net session using sql server mode

I am using a ASP.net session in SQL Server mode. I have created the necessary tables and stored procs in a custome db
My question is:
Can I use this database to serve more than one application / web site ?
Is there anything to take into consideration having multiple websites use the same db for their session store
cheers
Yes you can use this database to server more than one site. The session provider will take care of the semantics of that.
It would make the profiling more difficult if there is a performance problem. Why not create a second state db for the second application? It's not much to do, simple with a different name and specify the different db in your session configuration.
The short answer though is you can use the same session database and each session should be fine, though I wonder if anyone has any comments on colliding sessionIds between the two applications.

How can I set a username and password in sqlite3?

I am using sqlite3 in a linux machine and I am getting the database without username and password. Can I set a username and password for the same?
No, sqlite3 databases are very lightweight systems. They need no server and all data is stored in one file. A username/password is not supported by the sqlite/sqlite3 package.
In order to achieve simplicity, SQLite has had to sacrifice other characteristics that some people find useful, such as high concurrency, fine-grained access control, a rich set of built-in functions, stored procedures, esoteric SQL language features, XML and/or Java extensions, tera- or peta-byte scalability, and so forth.
(sqlite, when to use)
However, since it's only a file you can encrypt the file with a password to protect your data.
SQLite doesn't have a concept of username/password. It's just a single file based database.
However, on Unix you can protect your database from other users on the same machine by setting the permissions of the database file itself.
e.g. Allow only owner access
chmod 700 /path/to/sqlitedb
If it's used in a simple web application then the web application will provide the control.
The prior answers are only partially true. You can have databases that require authentication but you'll have to compile SQLite separately from PHP.
See the SQLite User Authentication documentation for further information.
SQLite is mainly an embedded database engine, not intended to be used as a multi-user database server that would require usernames and passwords.
You can always encrypt the database file with some user-provided password/-phrase, I guess. But expecting an embedded DBMS to sport full-blown access control is too much.

Resources