Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Sql Server Database from C plz helpppppppp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi everybody
can anyone tell me how to access sQlserver database from C language? i don't want to set/establish the link at the beginning through the wizard but want to do it programatically.I could do it with MS Access but not able to do in SQl server should i use Ole or Simple ODBC how do i do it some tips on coding plz . Driver name is SQL Server right but i am getting an error that it is not able to connect the server

plz helpppp
thanks in advance
kumuda
 
in ODBC API the sequence is
#include<sql.h>
.....
rc=SQLAllocEnv(&hEnv);
if(rc!=SQL_CUCCESS&&rc!=SUCCESS_WITH_INFO)
{
SQLError(.....);
}
rc=SQLAllocConnect(hEnv,&hConnection);
rc=SQLConnect/SQLDriverConnect(hConnetcion....);
......
......
rc=SQLDisconnect(hConnection);
rc=SQLFreeConnection(hConnection);
rc=SQLFreeEnd(hEnv); John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top