[unixODBC-dev] SQLConfigDataSource failing with sapdb driver

Ajit ajit at onmobile.com
Fri Aug 4 07:49:48 BST 2006


Hi,
 I am running 2.2.11 and am having a problem with SQLConfigDataSource
failing.

	SQLHENV   henv ;
	SQLCHAR     SqlState[6],  Msg[SQL_MAX_MESSAGE_LENGTH];
	SQLINTEGER    NativeError;
	SQLSMALLINT   MsgLen;
	SQLRETURN     rc2;

	SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
	SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
	BOOL x = SQLConfigDataSource(0,ODBC_ADD_SYS_DSN,"SAP DB", AttributeString);
	if (x !=TRUE)
	{
            DWORD temp;
            WORD temp2;
            rc2 =
SQLInstallerError(1,&temp,(char*)Msg,SQL_MAX_MESSAGE_LENGTH,&temp2);
		printf("Failed to create  System DSN %s",(char *) Msg);
		SQLFreeHandle (SQL_HANDLE_ENV,  henv);
		return -1;
	}

SQLinstallerError return the following
Failed to create  System DSN General installer error

The attribute string is as follows:
DSN=testdsn
Description=used by xxxxx
IsolationLevel=Committed
Driver=SAPDB
LongVarTrunc=SQL_NO_TOTAL
ServerDB=mmp
ServerNode=172.16.xx.xx
Sqlmode=Oracle

Can anyone spot the problem here??
I think the sapdb setup .so does not export a ConfigDSN method??
Any workarounds??
Regards,
Ajit




More information about the unixODBC-dev mailing list