Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect to SQL Server Database from Oracle Forms (ODBC)

2628768Mar 11 2014

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/password@ODBC: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.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 8 2014
Added on Mar 11 2014
0 comments
1,666 views