Friday, October 1, 2010

Issue when Visual C++ 6.0-Oracle Connection

This time was to test Visual C++ 6.0 and Oracle 9i database connectivity. Started my MFC App Wizard -> Single document -> Database view with/without file support then to choose the data source clicked on the data source button, selected OLE DB -> Select OLE DB Datasource, Microsoft OLE DB Provider for Oracle.

First I put the server name as my system name, this case too I am testing the program on local machine, that the database and the application are on same system, so I put the server name as my system name toshiba in place of "Enter server name" in Connection tab, also entered the user name and password hr, hr and then clicked the "Test connection", but I got an error message like this,

"Test connection failed because of an error in initializing  provider. ORA-12514 : TNS : Listener could not resolve SERVICE_NAME given in connect descriptor."


I tried different combination of server name (my system name toshiba) and SID, but the same error I got every time. Finally I removed server name, i.e kept the server name box blank and then tested connection. I got the result


"Test connection succeeded"

i.e. No need of server (system name) when testing it locally. just provide the user name and password only.

No comments:

Post a Comment