Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Do you mean microsoft SQL server, or some other RDBMS that uses SQL? If the former, I would try to find a library that alllows ODBC access in C. You can call into this library from Objective-C, and make a wrapper class around its functions if desired. Note that I have not had to solve this myself, so these are just my suggestions based on the approach I would take.

-Lee
Edit: too slow. If you want to be able to move between databases I would definitely write an interface that abstracts the DB, then implement that once per DB you need to target. This way no app code will need to change, since it will just use interface methods.
 

Monkaaay

macrumors 6502
Original poster
Jun 19, 2006
258
0
Richmond, VA
Do you mean microsoft SQL server, or some other RDBMS that uses SQL? If the former, I would try to find a library that alllows ODBC access in C. You can call into this library from Objective-C, and make a wrapper class around its functions if desired. Note that I have not had to solve this myself, so these are just my suggestions based on the approach I would take.

-Lee
Edit: too slow. If you want to be able to move between databases I would definitely write an interface that abstracts the DB, then implement that once per DB you need to target. This way no app code will need to change, since it will just use interface methods.

Solid advice, and I've done similar in Java and C# for other scenarios. My knowledge of Objective-C is non-existent so I'm not confident in being able to achieve that right now.

Would you still use ODBC in your abstraction suggestion for multiple RDBMS? I did a little bit of searching around and I'm finding small hints at using ODBC for my situation, so it's nice to hear someone else echoing that path.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.