Menu

#490 [ODBC] A problem of the returned value of OdbcConnection.DataSource property

open
nobody
None
5
2013-04-26
2013-04-26
Jira Trac
No

* Brief:
** OdbcConnection.DataSource propobaly returns an incorrect value

* Test Code:
{noformat}

[Test, Description(Test for OdbcConnection Property DataSource)]
public void ConnectProperties_DataSource()
{
string dataSource = CUBRID;
string strConn = Driver={CUBRID Driver};db_name=odbc_test;uid=dba;server=10.34.64.57;port=33037;fetch_size=100;
OdbcConnection connCubrid = new OdbcConnection(strConn);
connCubrid.Open();
Assert.AreEqual(dataSource, connCubrid.DataSource);
connCubrid.Close();
}

{noformat}

* Result: Expected: CUBRID But was: 10.34.64.57

* Description:
** The current ODBC driver returns OdbcConnection.DataSource property with the value of the Server Location (i.e. server ip address), But according to the MSDN specification: the DataSource property is equivalent to calling the ODBC function SQLGetInfo with the InfoType parameter set to SQL_SERVER_NAME (e.g. the Access ODBC returns ACCESS as the DataSource property, so the CUBRID ODBC may returns CUBRID as the DataSource Property)

Discussion