How would you connect to a Microsoft Access database sitting on a remote server through Objective-C?
I currently have an ASP page which I connect to from my Objective-C code, but I would like to know if any other method is possibly. I would like to just connect fr开发者_开发技巧om the iPhone to the Access database without the ASP page. I have tried Googling this problem, but I did not find anything useful. Links to tutorials or code snippets would both be very helpful.
You should write a webService which will connect to the database, and your iPhone app should be making calls to the webService ideally.
I can't answer inline but my answer relates to Vaibhav Tekam's answer...
You should be able to find some sample code that will wrap an access database with a web service. Just search for "web service access database" and you should find some examples. The best practice is to expose only the data that you need through a simple set of methods. If you have students in your access database, you'll want a method for getStudentList
and one for getStudentById(string studentId);
Nonetheless, you cannot connect to an access database directly from an external device (its possible but not recommended). You should use JSON to send and receive the data between your app and the web service.
There is no class in Cocoa to communicate with an access database. If you are anticipating more than about 10 people using your app, then you should move to a database platform that supports higher concurrency.
精彩评论