CADO 3
Assalamualaikum Waohmatullahi wabarakatuh Langsung saja teman teman, berikut adalah contoh Class koneksi C++ dengan menggunakan database SQL Server. CADO 3 file main() #include "ADO.h" #define DB_SERVER_IP "192.168.0.1" #define DB_NAME "MYDB" #define DB_USER_ID "admin" #define DB_USER_PW "password" int main(int argc, char* argv[]) { int nTemp; _RecordsetPtr rs = NULL; CADO myADO; if(!myADO.Connect(DB_SERVER_IP, DB_NAME, DB_USER_ID, DB_USER_PW)) printf("Fail to connect\n"); else printf("Connection success\n"); if(!myADO.SQLInsert("dbo.TEST", "4, 'babo'")) printf("Insert Fail\n"); else printf("Effected query successfully\n"); rs = myADO.SQLSelect("dbo.TEST"); if(rs==0) printf("Select Fail\n"); else nTemp = rs->GetCollect("nNum").intVal; // else // printf("Effected query successfully\n...