Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Connection error

Former Member
0 Likes
3,324

Need to connect from SAP 4.6 to SQL Server 2000.

Had written the following code. to connect to code to connect.

As well as made changes in the DBCON table.

DBMS: MSS

USER_NAME srvhadp

PASSWORD Password for setting up

the connection

to the database <pwd>/<pwd>

MSSQL SERVER=GRDSQL01 MSSQLDBNAME=SRA

and wrote this Z program to connect its giving the following runtime error

DBIF_DSQL2_CONNECTSTR_ERROR

REPORT ZDBCON .

EXEC SQL.

CONNECT TO 'GRDSQL01' AS 'V'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'V'

ENDEXEC.

Please guide and help.

Regards,

Kamlesh

15 REPLIES 15
Read only

Former Member
0 Likes
2,193

Hi

Is GRDSQL01 the connection name given in DBCON?

Regards,

Raj

Read only

0 Likes
2,193

Yes

Read only

Former Member
0 Likes
2,193

Hi

Are these two servers (SAP and MSS) are in the same intranet?

Because, once i faced the same problem connecting to MSS server. Once they changed the network properties, i was able to successfully connect to MSS server.

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

Read only

0 Likes
2,193

I checked it. Its not changed.

what else can be the problem.what do u want me to check else.

Read only

Former Member
0 Likes
2,193

Hi

In your case SRA is the MSS server name and the username and pwd are the one used to connect to that MSS server, am I right? Thats the way it should be.

Can you confir the same? Are you able to login to MSS server (SRA) using those credentials?

Regards,

Raj

Read only

0 Likes
2,193

SRA is the database name and

MSSQL _SERVER=GRDSQL01

Read only

Former Member
0 Likes
2,193

Hi

Found the below exceptions. See if they make any sense.

Regards,

Raj

Exceptions

Catchable Exceptions

CX_SY_NATIVE_SQL_ERROR

Cause: Error during setup of a secondary database connection.

Runtime Error: DBIF_DSQL2_CONNECTERR

Cause: The specified secondary database connection is not entered in table DBCON.

Runtime Error: DBIF_DSQL2_CONNECTSTR_ERROR

Cause: Error during COMMIT or ROLLBACK to "DEFAULT" database connection.

Runtime Error: DBIF_DSQL2_DEFAULT_CR_ERROR

Cause: An internal error occurred during exection of Native SQL.

Runtime Error: DBIF_DSQL2_INTERNAL_ERROR

Cause: Incorrect environment variable in table DBCON for setup of connection to R/3- or an external database (multi-connect). At the beginning of the connection, the values of the environment variables are read from table DBCON and analyzed. This check showed that the values are longer than allowed or that environment variables for the connection setup are missing.

Runtime Error: DBIF_DSQL2_INVALENV_ERROR

Cause: Invalid interruption of a database selection. The cursor was closed.

Runtime Error: DBIF_DSQL2_INVALID_CURSOR:

Cause: The DSQL interface was called using invalid parameters. In the system log (SM21) you will find further explanations on these incorrect parameters.

Runtime Error: DBIF_DSQL2_INVALID_REQUEST

Cause: A data record with the specified key already exists.

Runtime Error: DBIF_DSQL2_KEY_ALREADY_EXISTS

Cause: The specified key was not found in the database.

Runtime Error: DBIF_DSQL2_KEY_NOT_FOUND

Cause: Another internal internal error occurred during COMMIT or ROLLBACK.

Runtime Error: DBIF_DSQL2_MIXED_CR_ERROR

Cause: An error occurred during COMMIT or ROLLBACK to a Native SQL database connection.

Runtime Error: DBIF_DSQL2_NATIVE_CR_ERROR

Cause: No storage space available for a Native SQL statement any longer.

Runtime Error: DBIF_DSQL2_NO_MEMORY

Cause: The database object already exists in the database. There was an attempt to create a database object (table, view, index, ...) in the database. This oject, however, already exists.

Runtime Error: DBIF_DSQL2_OBJ_EXISTS

Cause: You worked with the name of a table or a view that does not exist in the database.

Runtime Error: DBIF_DSQL2_OBJ_UNKNOWN

Cause: There is an SQL error during execution of a Native SQL command.

Runtime Error: DBIF_DSQL2_SQL_ERROR

Cause: The database interface gave an unexpected return code.

Runtime Error: DBIF_DSQL2_UNEXPECTED_CODE

Cause: The maximum number of secondary database connections has been exceeded.

Runtime Error: EXSQL_CONNECTION_LIMIT

Cause: The maximum number of cursors has been exceeded.

Runtime Error: EXSQL_DSQL_CURSOR_LIMIT

Read only

0 Likes
2,193

Cause: Error during setup of a secondary database connection.

Runtime Error: DBIF_DSQL2_CONNECTERR

I had got this error. what do u mean by secondary database.

Read only

Former Member
0 Likes
2,193

Hi

All databases other than SAP's own come under secondary databases.

To access these secondary databases, you create DBCON entries (Database connection), through which you connect to them.

Did u do a 'Test Connection' from within SAP(Trxn DBCA)?

Regards,

Raj

Read only

0 Likes
2,193

hi Raj

DBCA is a table or a transaction. I tried it in se11, se16.

plus I suppose I would need more guidance from u.

Read only

Former Member
0 Likes
2,193

Hi

dbca is a transaction.

give me your mailid...will mail u the document i have.

Regards,

Raj

Read only

0 Likes
2,193

ka.chhabria@gmail.com.

Thanks

Kamlesh

Read only

0 Likes
2,193

Hi Raj,

kindly mail me the document.

Thanks,

Kamlesh

Read only

0 Likes
2,193

Hi Raj,

I am still not being able to get the connection done. does the basis guy need to do anything into it.

I request you to please also mail me the document which u were suppose to send.

Read only

0 Likes
2,193

Hi,

I have the same error and can't manage to connect to my MSSQL Server from SAP (ECC5 640 / NT / Oracle database).

Moreover, I tried DBCA transaction and it doesn't exist. Can you please forward your document to me ? and explain to me how to check what is wrong (DBCO, RFC, TCP/IP...) ?

Mail: avanpeene@fiveslille.com

Thanks,

Arni