How to access an existing database file through html5? - html

I'm working on an desktop app(hta) that need to access information from a database.
My challenge is that already I have the data I need in a sqlite database file. I just want to access this database file from my app then manipulate and display the results to the users.Is it possible to deploy an app like this? I'm not finding a way to access an existing database file through html5.(The sqlite database file will be created during the app installation.It is present in C:\filepath)

The solution will depend on your use case. I can see two of them.
1. Your application runs in disconnected mode (standalone)
HTML5 provides an API called Web SQL Database. It enables you to access an API for storage in the web browser. It's pretty much build around SQLite features. However, all the web browsers do not support it.
2. Your application can access a remote server
In the case you have a remote database, and your application is allowed to access it, I would suggest that you connect to your database by making requests to it. Of course, you will require to develop your own little API on the server side to access the database e.g. via XmlHttpRequest.

You can use javascript to access Web SQL databases. Remember, Web SQL is deprecated and only supported in Chrome and Safari. And Web SQL isn’t even actually part of the HTML5 specification.
For a starter's guide: HTML5 Doctor: Introduction to Web SQL Databases

Related

How to link Microsoft Access Database file with HTML

I created a table in Microsoft Access Database and I wanted to use this database in the website I built with HTML. The problem is that I don't know how to link the database file to my website (or to the form inside the body of the HTML file, I actually don't even know how it works...). Can you help me?
Honestly i don't know much about Microsoft Access Database . I assume it is like other databases.
But, if you would like information that you made within a database to be shown in html, it will take much more than just html. There are a few paths you can take depending on what you want to accomplish.
The first thing is that your Database (hereby named "DB") needs to be accessible online (where your web page would live). Unless Microsoft Access Database is a "Cloud based" DB.
I use Microsoft Sql Server Management Studio (MSSM) for by DB needs, but MongoDB is a cloud based solution.
With MSSM you can use Amazon Web Services to create a webserver that runs MSSM and is accessible via the cloud.
The second thing to do would be to be able to get information from your DB to your webpage. There may be an easier solution, which I will recommend. I use C# to do this, but I know it can also be done with Ruby, and NodeJS. Within either of those languages, you will need an Object Relational Mapper (ORM), to read the info from your DB and then Create,Read,Update or Delete (CRUD) to and from your DB. An example of an ORM is EntityFrameWork or Nhibernate.
But there is a different way. If you are ok with not using a DB, you can use XML or JSON files much the same way as a DB. Which is what I did.
My github repo
Check out my non-db solution
The short version is that all of your info in your DB can be represented using .JSON files.You can then use Javascript (or Jquery) to view and display (not update) the info.
if you need help with this, leave a way to contact you, it is too much to put here.
How you do this will depend on your web development tools.
And it also depends on your web hosting company.
Remember, a web server is just a computer. It not really much different of a computer then your desktop.
And on your desktop, if you want to use say word, then you need word installed.
And on your web server, if you want to write code say in python, or asp.net, then your web site computer has to support that type of programming language.
So a web site that connects to a database will mean that you have to write some code in the web programming system of your choice. (However, that choice is limited to the tools available on that web site just like if word or say FoxPro, or Access is installed on your desktop computer.
So quite a few web hosting companies do support using an Access database. Note that this is ONLY the data part they support (so just the tables, not VBA code or forms/reports).
So, you have to either:
Pick some web programming languages you like or are familiar with, and then
Choose a web hosting provider that supports the programming language(s) you want or like to use.
Or, check your current web hosting provider and learn the tools and programming language(s) that they currently support.
For example, a really common development stack (set of tools) is called LAMP.
Lamp = Linux, Apache, MySQL, PHP.
So, if they support LAMP, then the server is a Linux server, the web server system is Apache, and the database is MySQL, and the programming language is PHP.
Keep in mind that Access does not work on the LAMP stack. (It is not a windows server, and just like you can’t install Access on an Apple Mac, you can’t install the Access data drivers on a LAMP server.
However, in most cases you don’t really care, because your code going to be the same if you pull table data from SQL server, MySQL server, or a Access database. In all 3 cases, you going to write some SQL queries against that database (to be fair, the SQL flavors do vary a bit. So Access SQL is mostly the same as SQL server, but there are minor differences). Since your code can ONLY use the tables, then you tend to not care much if the tables are in Access or MySQL. Your SQL queries you write will be VERY similar no matter what database you use to hold the tables.
If your web hosting provider supports and uses asp.net, then that web server is a Microsoft server. These are the ones that support using Access databases. And asp.net programming languages can be c# or vb.net. VB.net is nice, since it reads and you can code very much like VBA code (the syntax is very similar). And web pages (web forms) have event models somewhat similar to what you use on the Access desktop.
So, HTML alone is not sufficient for writing code. HTML can lay out some text on a web page, but it does not allow you to write code with SQL and loops and everything you come to expect with a programming language like we have say in Access (VBA).
So what kind of web server is hosting your web pages will determine what programming languages are installed and can be used on the web computer.
Apache is a common web server. That web server can dish out HTML pages, but ALSO allow you to write code for the web page. It is the coding part that allows you to execute SQL against the database to return data, and shove it into the HTML page that you have created.
If you using an IBM server, then the web server is WebSphere.
And if you using ASP.net, then the web server is IIS (internet information services).
So there is “many” different kinds of web servers. While any of these web servers (the server that dishes out web pages to users) allow HTML, they all use different programming languages.
Also, because the database used (Access, MySQL, SQL server etc.) only holds the tables, so at the end of the day, it tends to not be a big deal if you use Access to hold some tables, or say using MySQL database to hold the tables.
However, say if you have experience with SQL server from Microsoft, and are comfortable with that system, then it makes sense to choose a web server (hosting provider) that supports SQL server, since you will be familiar with that database server more than say using MySQL or Oracle databases.
So, how you get your data into the HTML page will depend on what web programming language your web hosting provider supports.
So you either choose the tools your current web hosting provider supports, or you pick the web programming tools and languages you like, and find a web hosting provider that supports those programming languages.
So this is not different then say choosing Access. If you choose and like Access, then you can’t run your software on an Apple Mac.
And of course if you use some Mac programming language, then you can’t run that software on windows.
So, how this works is exactly the same for when you choose a web server. That web server will run windows software, or say often Linux software. So you have use and write code that the given web hosting system you are using supports.
A web server is just a computer with software installed. If you want to write some code to pull the data, then you write that code in some programming language that is installed and supporting on the web server system you are using.
So, web sites that dish out data are NOT just HTML but also will have code written to send SQL to the database, and pull that data into the web page. What programing you choose is quite much like what kind of ice cream you like. (You have lots of choices here).
So web hosting systems support HTML, but EVEN what features of HTML are supported will vary from hosting provider to provider.

iOS and Mac OSX communicating with MySQL database

I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.
I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.
One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).
I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example

How to Make an Online / Offline Phonegap Application

I am investigating using HTML5 for a new suite of mobile applications that our company will be writing.
I found this demo here,
http://phonegap.com/start#android
Which shows how to use eclipse to generate and run an android application which is written using HTML.
Just wondering whether there is any information around about writing an online / offline application? This application would collect data based on the user input, and that data would be sent off to a central server and put into our central SQL server database.
What mechanisms could be used to connect and send the data to the server for instance?
Another requirement would be that some data would have to be sent and cached on the device, data related to the tasks that the logged in user has to perform.
You can interact with your server by applying traditional javascript techniques, like ajax, or other cross-domain methods like jsonp, iframes, etc.
The HTML5 localStorage will help you saving data on the local device, it's very useful when your data can be expressed as strings. But if your app requires more powerful tool for local data management, you can make a phonegap plugin with native code for anything you want.
In case of Offline-mode save the data in Local Storage which is feature of HTML 5. Whenever the user in Online Sync the data with the server. In case the data to be stored locally is quite large then use PhoneGap that allows to store some big stuffs
[Ref.: http://docs.phonegap.com/en/2.7.0/cordova_storage_storage.md.html#Storage].

Develop an iOS App that gets contents from a remote DB

I am developing an education app for Kids.
The application is going to contain pictures, stories and video as well.
Including all above contents in the app will surely bloat it and hence i would like store all data on a server that will be accessed by my app.
I haven't used any remote databases (like MySQL or Oracle) with any other iOS app. In fact i am a newbie in developing such kind of apps. Can any one point me to a sample
Connecting to a remote mysql is really not recommended.
The security here is critical.
You should create a webservice and my advice to you is to make sure that the access to the webservice is restricted
The webservice can be your own "protocol" or any other well known protocol like SOAP
By your own I mean, json, csv .... or whatever.
Edit 1
The technology of your webservice should be dependent on many things.
If the system is small, and the code needs to be update very often, I would suggest to do it with PHP and some small(!) MVC framework like CI.
But if its a large system with needs of ACL (access control list) I will probably choose java with spring...
I suggest that : Do not connect to / use database directly from user application. It may causes serious security problems and your app should have native SQL drivers to connect db.
So, create a web service that receive queries from the application and response in XML, JSON or some other strings that easy to parse. This will be much easier than embed native APIs into your apps.

Is it possible to host Access forms online?

I have developed a few forms for analysing data on a access database. Now I would like to know if it would be possible to host the forms on a link over the net having the database in a different system. Basically I want the database to be in a different system, the user should see the forms and use it but all processing, must take place in the system where the database is. The user must then be able to see the results.
Is this possible?
No, it's not possible. The web has a separate client for user interaction (usually the browser) and a server for storage. Browsers do not support Access for GUI interaction.
However, you can still use Access for storage (although this is not advisable), but you will have to find a solution for converting the Access forms to web forms. Fortunately, there are plenty of tools available that can do that for you.
There are various limitations in Access/Sharepoint combination. Like union query is not supported in web access and other things. Access can be better deployed over net by using remote connection with mysql (or other server dedicated or cloud) as backend.
Since Access 2010, it is possible to run Access forms on-line. This can be seen in Access 2010: Outlook-Style Calendar in Browser, by Albert Kallal