‎2012 Mar 04 4:11 PM
Dear ABAPers;
i just have in my application a Z program that connects to SQL database using the following code
DATA: sql(1024)
sql = 'Provider="sqloledb";Data Source="SQL server machine";Initial Catalog="Database name";User Id="admin";Password="password"'.
CALL METHOD OF con 'Open'
EXPORTING #1 = sql.
IF sy-subrc <> 0.
Error = 'No Connection Between SQL Server and SAP'.
ENDIF.
what i want to do is to make this program connects to oracle database, so i changed the code as follows
DATA: oracle(1024)
oracle = 'Provider="OraOLEDB.Oracle";port="1527";Data Source="Oracle server machine";Initial Catalog="database name";User Id="system";Password="123456"'.
CALL METHOD OF con 'Open'
EXPORTING #1 = oracle.
IF sy-subrc <> 0.
Error = 'No Connection Between Oracle Server and SAP'.
ENDIF.
but the problem is that the connection fails, i don't know why.
Regards;
Abdow
‎2012 Mar 05 4:38 AM
‎2012 Mar 05 8:31 AM
Hi Ahmed,
Please check whether you had given correct Application Server, System Number, or Client details.
Because you may get connection failed error only when these details are incorrect .Please verify it.
If you want you can refer this forum
Thanks and Regards,
Dhaya.G
Edited by: Dhayalinie Ganesh on Mar 5, 2012 9:36 AM