Home » Developer & Programmer » Precompilers, OCI & OCCI » Problem connect to Database!Please help me
Problem connect to Database!Please help me [message #362097] Sun, 30 November 2008 20:31 Go to next message
rojiblancos
Messages: 1
Registered: November 2008
Junior Member
i used example in demo directory to connect Datatbase.

I used "ansidyn1" example. But i can connect to my DB.
I have just modified oracle_connect in sample code(in ansidyn1.pc),follow it:
EXEC SQL BEGIN DECLARE SECTION;
	VARCHAR  username[128];
        VARCHAR  password[32];
	char  DB_NAME[30] = "servertest";
	char db_string[20]= "vitcendb";
    EXEC SQL END DECLARE SECTION;

......

 EXEC SQL CONNECT :username IDENTIFIED BY :password
	AT :DB_NAME USING :db_string;


and in my tnsname.ora
servertest =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.191)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = vitcendb)
    )
  )



i compiled in in VC6++(using ansidyn.dsp) but cant connect to DB
please tell me what's wrong?
username and password is correct!
thanks much!

[Updated on: Sun, 30 November 2008 20:32]

Report message to a moderator

Re: Problem connect to Database!Please help me [message #362103 is a reply to message #362097] Sun, 30 November 2008 23:27 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
but cant connect to DB
please tell me what's wrong?

What is the error?

Regards
Michel
Previous Topic: Example for OCI or OCCI needed
Next Topic: Unable to Insert XML data into XMLType Table :-(
Goto Forum:
  


Current Time: Sat Nov 23 06:54:50 CST 2024