Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2003
    Posts
    3

    Unanswered: OCI basic concepts?

    A VB program uses ODBC to UPDATE and SELECT statements from my Oracle 9i DB. For performance gains I have to now use OCI. I have some sample code which may work, however I need to know how I connect my c program with my VB program. I didnt figure my OCI.c should be and exe. What should I compile the C program as? It doesnt need a main does it?

    I am not familiar with c (but am with java) and I know nothing of OCI and am not an expert at VB. Any pointers are greatly appreceated.

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Its been ages since I've coded in C on a PC but I think you need to compile it as a DLL which you include in your VB project.

    Alan

  3. #3
    Join Date
    Jun 2003
    Posts
    3
    Thanks for the tip. Anyone else out there have even a guess? I dont believe it should be a .dll, because neither of my samples of code have the required headers that declare it a dll. Of course I am way off track, and any assistance is greatly appreciated. Is the only way to call a c program, if its a .dll?

  4. #4
    Join Date
    Oct 2002
    Location
    Plymouth UK
    Posts
    116
    I haven't used OCI with C yet. However there is an excellent 'how to' write up in Thomas Kyte's book Expert one-on-one Oracle, Wrox ISBM 1-861004-82-6

  5. #5
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    You need to convert your code sample to work as a DLL so that your VB program can call it, this isnt a major task. You could do it as an exe but getting your VB app to talk to it would probably be more complex and probably much slower. Look up on the net how to write dlls in C and how to call dlls from VB, after all the Oracle client libraries are DLLs and for good reason.

    Alan

  6. #6
    Join Date
    Jun 2003
    Posts
    3

    thanks

    After your initial post I realized that .dll was the way forward. I still have much to learn, but thanks for helping me get to the right path alanP Oh! What are the diffrences in the wizard for a Empty dll, a simple dll, or one that exports symbols. I am using MVC++.

Posting Permissions

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