SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Ошибка DBIF_DSQL2_CONNECTERR при коннекте к MSSQL



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
seal
Участник
Участник



Joined: 25 Sep 2007
Posts: 18

PostPosted: Sat Oct 13, 2007 1:18 pm    Post subject: Ошибка DBIF_DSQL2_CONNECTERR при коннекте к MSSQL Reply with quote

Привет!
При коннекте к внешней MSSQL базе данных возникает ошибка "DBIF_DSQL2_CONNECTERR error". В чем может быть дело?
Back to top
View user's profile Send private message
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Mon Oct 15, 2007 12:14 am    Post subject: Reply with quote

Мало данных для анализа ошибки.
Посмотрите, что пишется в
ST11 Display developer trace
и изучите ноту 178949

Quote:

Note 178949 - MSSQL: Database MultiConnect with EXEC SQL

Reason and Prerequisites
It's desired to make a connection to a SQL Server database running on a server different from the R/3 server.

Prerequisite: At least one Windows application server must be available on the R/3 system and the DBSL dynamic library (DLL) dbmssslib.dll must be installed on this server. This dll can be downloaded from the SAP Service Marketplace.

NOTE: Currently this DBSL library is only available for the Microsoft Windows Operating System. UNIX application servers cannot be used to connect to a remote MS SQL Server.


Solution
Basics of the EXEC SQL MultiConnect
OPEN SQL database accesses always refer to the R/3 database for the particular R/3 system's <SID> (three letter uppercase database name). EXEC SQL accesses normally also refer to the R/3 database. To access data which is on the R/3 database server in a database other than the <SID> database, it is sufficient to enter the table name qualified by the database name in EXEC SQL.
Example:
EXEC SQL.
SELECT MYFIELD FROM MYDB..MYTABLE
ENDEXEC.
Furthermore, you have the option in R/3 to access data with EXEC SQL which are on other SQL Server systems.

Creating a DBCON entry for a remote connection
Every link which should be addressed via the Multiconnect must be described by a record in table DBCON. This entry can be created by means of the transaction sm30. For SQL Server create an entry as follows:

CON_NAME: <my_conn_name>
DBMS: MSS
USER_NAME: <db_user>
PASSWORD: <password>
CON_ENV: MSSQL_SERVER=<server_name> MSSQL_DBNAME=<db_name>


db_user could be sapr3 for example if the server is running R/3. The password field may be blocked from view by asterisks in sm30. USER_NAME can be left blank in order to use integrated security (4.6d kernel and later). In that case make sure that the OS User running R/3 has the required privilege on the remote server. A dummy password must be entered in sm30, it will not be used when the user name is blank.


Specifying the server name
The server name is simply the name of the SQL Server or named instance i.e. the hostname (for a default instance), or <host>\<instname>
Starting with release 6.40 however there are some special considerations that should be taken into account. When running with kernel release 6.40 or later, the R/3 system will prepend a protocol specifier to the server name. Example:
1. For a server running on the same server:
np:<servername>
2. For a remote server:
tcp:<servername>
This forces the connection to be made with a named pipes and tcp/ipprotocols respectively.
When specifying the server name you can override this by setting your own protocol (tcp: or np:), or you can make R/3 avoid setting any prefix by using simply :<servername> - a colon in front of the server name.


How to use the Multiconnect
Here is an example for how to connect to another server with CON_NAME=BSK. The example assumes BSK is running R/3:


EXEC SQL.
CONNECT TO 'BSK'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'BSK'
ENDEXEC.
EXEC SQL.
SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
WRITE: / 'current database name', DBN.
EXEC SQL.
SET CONNECTION DEFAULT
ENDEXEC.
EXEC SQL.
SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
WRITE: / 'current database name', DBN.

Tools for creating DBCON entries
In SAP basis release 6. 40 new tools were introduced to make it easier to create DBCON entries for use in remote monitoring. These tools are accessible through st04_mss -> "Change connection data" button -> Go To -> "Maintain DBCON" for example.
The "Change connection data" button is the small pencil icon on the right hand side of the main st04_mss screen.

There is an on-line guide for creating DBCON entries this way. It is available on:

http://help.sap.com
Documentation -> SAP NetWeaver -> SAP NetWeaver '04

And then expand the tree on the left hand side using SAP NetWeaver -> Application Platform -> Databases -> SAP/MS SQL Server 2000 DBA in CCMS.

Finally go to Database Management Tools -> Monitoring Remote SQL Server Databases -> Setting Up the Remote Connection -> Creating a DBCON Entry.






Header Data


Release Status: Released for Customer
Released on: 20.10.2006 14:18:07
Priority: Recommendations/additional info
Category: Consulting
Primary Component: BC-DB-MSS Microsoft SQL Server

Releases

Release Independant

Related Notes



829706 - MSSQL: DB Multiconnect in the MSSPROCS program

738371 - Creating DBCON multiconnect entries for SQL Server

512739 - BW external DB Connect for MS SQLServer

323151 - Several DB connections with Native SQL

160484 - DB2/390: Database multiconnect with EXEC SQL

146624 - AS/400: Database Multiconnect with EXEC SQL and ADBC

117261 - Multiconnect and DB procedure enhancements for 4.0B

44977 - EXEC SQL: New features
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.