help in code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: help in code

  1. #1
    Join Date
    Mar 2013
    Posts
    11

    help in code

    hey , i am using this code for database connection but it is giving error




    #include "/opt/redknee/home/rel76d1/mediation//3rdparty/ocilib/include/ocilib.h"
    int main(void)
    {
    OCI_Connection *cn;
    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
    return EXIT_FAILURE;
    //cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    cn = OCI_createConnection("rel76d1", "rte", "rted1", OCI_SESSION_DEFAULT);
    if (cn != NULL)
    {
    printf(OCI_GetVersionServer(cn));
    printf("Server major version : %i\n", OCI_GetServerMajorVersion(cn));
    printf("Server minor version : %i\n", OCI_GetServerMinorVersion(cn));
    printf("Server revision version : %i\n", OCI_GetServerRevisionVersion(cn));
    printf("Connection version : %i\n", OCI_GetVersionConnection(cn));
    /*... application code here ...*/
    OCI_ConnectionFree(cn);
    }
    OCI_Cleanup();
    return EXIT_SUCCESS;
    }


    but on compling it is giving error oci_createConnection() was not declared in yhis scope.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,352

    Re: help in code

    Quote Originally Posted by ramsavi View Post
    but on compling it is giving error oci_createConnection() was not declared in yhis scope.
    Then find out where oci_createConnection() is declared (perhaps, you will have to read some documentation) and then #include the corresponding header file!

    And please, use Code tags while posting code snippets!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center