on 09-28-2015 12:03 PM
hello all,
i'd like to instance a sqlconnection from an addin in order to directly connect to sap db, using microsoft sql client default libraries...
we are facing serious performance problems with simple queries using the standard sdk object recordset.
we tried building the connection string with this method but the property dbpassword is always a bunch of *
public static String GetSQLClientConnectionString()
{
String retVal = String.Empty;
String connStringBase = "Server={0};Database={1};User Id={2};Password={3};";
retVal = String.Format(connStringBase,
CompanyHelper.Instance.Company.Server,
CompanyHelper.Instance.Company.CompanyDB,
CompanyHelper.Instance.Company.DbUserName,
CompanyHelper.Instance.Company.DbPassword);
return retVal;
}
as documentation tells us about dbproperty this is an expected beahaviour:
Description
Sets or returns the password for establishing a connection to the database server.
The field is not mandatory, as the database credentials are stored in the license server and you can use these values instead.
Property type
Read-write property
Syntax
Visual Basic
Public Property DbPassword() As String
Remarks
When you retrieve the value of the DbPassword field, ****** is returned.
If you set a value to the DbUserName field, then that value is returned when you get a value from this field. If you connected without providing a database user name (relying on the credentials stored in the license server), then an empty string is returned.
now i'd like to know if it is possible to get a clear password in order to build a proper sql connection string without storing it in a configuration file?
thanks in advance
I think u went to the wrong direction. You are trying to increase performance on sql query.
Based on my past experience, direct connection with SQL is pretty much same as BoRecordSet object. I couldn't tell the difference.
If you suffer performance issue from query, I would suggest either tune up your sql query, or write functions or store procedure to increase performance.
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i can confirm our performance issue on a simple query ( select with 2 left outer joins made on indexed tables ) is present only on borecordset object.
this happens only on a couple of system tables joined with certain user defined tables.
the performance gain using sql client with the same query is about ten times.
borecordset is a wrapper around 2005 metods to query a db, maybe using odbc or if we are lucky ado, so i wouldn't compare it to a newer db connector.
we discovered with query analyzer that the underlying query more or less lasts the same, but clearly borecordset is doing something else before or after the query itself.
btw we submitted our problem to sap b1 support and as soon as we receive an answer i will post it there!
thanks for your support!
Hi Christian,
I believe that you need store the password in a configuration file.
As you said: "When you retrieve the value of the DbPassword field, ****** is returned" is the same advise that is in the sdk help
In this post Sql connection string SAP Business One | SCN, Owen Slater said: "There is no way to get the SQL connection string that the SBO client is using programmatically".
Regards,
Diego
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
It would never happened.
Password is supposed to be secret and guarded.
If SAP is giving you a method to decrypt the password, then they are compromising the security of the system it self.
I agree with , Recordset object only put a wrapper to your SQL query and execute it in DBServer.
In terms of performance, I have never had much different. Especially when you said simple queries.
Can you give us your simple query and let us try so we can learn together ?
Regards
Edy
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.