Results 1 to 4 of 4

Thread: Using SQL functions in MFC apps

  1. #1

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196

    Using SQL functions in MFC apps

    I have tried to use some SQL functions - SQLAllocHandle, etc etc in my application. I have written a console app using it which works great. However, when I add the code to an MFC app, when I compile I get something like:

    Code:
    DuplicateManager.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@12
    Release/DuplicateManager.exe : fatal error LNK1120: 1 unresolved externals
    Can anyone tell me why? And also how to sort it out. In the meantime I have moved the SQL access functions into a dll, where they can be called - but this is inefficient.

    Thanks

    HD

  2. #2
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Have u got ODBC Lib linked up to your application? Seems like a typical "missing remote function", provided by a missing/outdated lib file.
    VS.NET 2003

    Need to email me?

  3. #3

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    You're probably right.

    Is it only ODBC32.lib and ODBCCP32.lib that I need to add and how do I add these to the link options in an MFC project? (I know that CDatabase can be used, but currently that is not the issue).

    Thanks for any help

    HD

  4. #4
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Add the links just like to any other normal project. Project Settings->Link->Object lilbrary modules. Just add them to the end.
    VS.NET 2003

    Need to email me?

Posting Permissions

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



Click Here to Expand Forum to Full Width