开发者

How to connect to SQL through C?

开发者 https://www.devze.com 2023-02-18 14:48 出处:网络
I am making a project in C and I need database access. How would you connect to and access a database in the C lang开发者_如何学编程uage? I am using MySQL currently.There are many solutions, depending

I am making a project in C and I need database access. How would you connect to and access a database in the C lang开发者_如何学编程uage? I am using MySQL currently.


There are many solutions, depending on which database you are using and which OS you are using. One solution that will provide broad access to an array of combinations would be ODBC. You would connect to the database with a function like SQLConnect and use the other API functions to do your queries.

The links are windows specific, but you should be able to find analogs for whatever OS you will be using on your client side.


Depending on why you actually need to use a database (you didn't say) you could start using SQLite to develop your application.

Once you have it working and you have decided on which server you want to use (MySQL, MS SQL Server, Oracle, etc.) you can then read the documentation on creating a connection specific to that database server.

0

精彩评论

暂无评论...
验证码 换一张
取 消