Click here to Skip to main content
13,141,429 members (88,191 online)
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 27 Sep 2002

C++ wrapper for Sybase's OPENCLIENT Interface

, 27 Sep 2002
Rate this:
Please Sign up or sign in to vote.
This article will provide a cross platform C++ wrapper for Sybase's OPENCLIENT interface.


With this C++ wrapper, you can easily do the following:

  • Connect/disconnect to a Sybase server;
  • Execute SQL select/insert/update/delete commands;
  • Store the query result in a simple linked list;

This project is a cross platform implementation.

class  ObList ;
class  Record ;
class  RecordSet;
int Connect();
int Connect(char *user, char *pass, char *service);
void DisConnect();
int ExecCommand(char* cmdbuf);


#include <stdio.h>
#include "dbclient.h"

int main(int argc, char* argv[])
    RecordSet set;
    set.Open("select * from EMP");
    for(int k=0;k<set.GetRecordsCount();k++)
        Record *pRec=set.GetRecord(k);
        for(int l=0;l<pRec->GetFieldsCount();l++)

    return 0;

If you are interested in this article, and want to get details, contact me at or


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
6 years Programer With VC++

You may also be interested in...

Comments and Discussions

QuestionWhich is better? Pin
neeraj khan1-Aug-16 14:24
memberneeraj khan1-Aug-16 14:24 
Questionerror message ????? Pin
seoktaegoon22-Jul-10 1:30
memberseoktaegoon22-Jul-10 1:30 
Questioni have problem this part? Pin
seoktaegoon22-Jul-10 0:11
memberseoktaegoon22-Jul-10 0:11 
Generalwhen compile missing lots of .h file Pin
bill chuang2-Sep-04 22:04
memberbill chuang2-Sep-04 22:04 
GeneralRe: when compile missing lots of .h file Pin
Rohit Joshi22-Sep-04 9:23
memberRohit Joshi22-Sep-04 9:23 
You need to have sybase PCClient or ASE server installed. It would be under %SYBASE%/OCS-XX-X/include. You should set the library path also.
He has take "C" files from %SYBASE%/OCS-XX-X/samples directory.
GeneralRe: when compile missing lots of .h file Pin
anuradhatp12-Jun-07 7:07
memberanuradhatp12-Jun-07 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 28 Sep 2002
Article Copyright 2002 by lihaijian
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid