Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Anyone knows how to connect to SQL Server database using a C program?

What I have tried:

I already tried some solutions on the internet, but most are directed to C++
Posted
Updated 8-Apr-18 7:34am

Perhaps the simplest way is to use ODBC. To get started with, have a look at
- Allocate Handles and Connect to SQL Server (ODBC) | Microsoft Docs[^]
- Using ODBC with Microsoft SQL Server[^]

The second one is a bit old but mostly relevant. It's written using ODBC 2.5 but the basic functions are the same.
 
Share this answer
 
Take a lock, if you need it still

Database Connectivity using C/C++ - GeeksforGeeks[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900