Precompilers and OCI (MOSC)

MOSC Banner

OCCI + VS2010 + C++/CLI - help!

edited Mar 20, 2012 7:40AM in Precompilers and OCI (MOSC) 5 commentsAnswered ✓
 I have a basic "prove you can connect" app written in C++ under VS2010 using a console app - it works.
The same code adapted to a C++/CLI Windows Forms app will not link.

#include <iostream>
#include <occi.h>
namespace oc = oracle::occi;

int main()
{
try
{
oc::Environment* env = oc::Environment::createEnvironment(); 
oc::Connection* conn = env->createConnection("user", "pword", "svr"); 
oc::Statement* stmt = conn->createStatement("select * from core.master_cmdy"); 
oc::ResultSet* res = stmt->executeQuery();
while(res->next())
{
std::cout << res->getString(1) << std::endl;
}

stmt->closeResultSet(res);
conn->terminateStatement(stmt);
env->terminateConnection(conn);
oc::Environment::terminateEnvironment(env);
}
catch(const oc::SQLException& e)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center