Forum Stats

  • 3,827,146 Users
  • 2,260,746 Discussions
  • 7,897,182 Comments

Discussions

Connect to SQL Server Database from Oracle Forms (ODBC)

2628768
2628768 Member Posts: 1
edited Mar 11, 2014 5:35AM in ODBC

Hi,

I need to connect to SQL Server database from Oracle Forms. I tried using the ODBC data source and the connection established successfully, but I was not able to connect to the database from just inside the Oracle Forms.

Should I have Open Client Adapter to be installed on my machine, if so, please direct me to the website so I can download it as I was not able to find it.

Below is the code I use in Oracle Forms to connect to the database.

Declare

Connection_id  EXEC_SQL.ConnType;

Begin

  connection_id := EXEC_SQL.OPEN_CONNECTION(username/[email protected]:data_source_name);

  if EXEC_SQL.IS_CONNECTED(connection_id) then

     msgbox('Connected');

else

  msgbox('ERROR: No connection established');

end if;

Exception

  when others then

   msgbox(sqlerrm);

   msgbox('ERROR: No connection established');

end;

Thank you and appreciate your help.

This discussion has been closed.