-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Sujay
Message 1 in Discussion
Hello ,
I am using the ::SQLConfigDataSource to create a DSN programatically
The function works fine , when I am hardcoding the values like below :-
// WORKING CODE
bResult = ::SQLConfigDataSource( NULL,
ODBC_ADD_DSN,
"Microsoft ODBC for Oracle",
"ConnectString=DDWCCF\0"
"DSN=MyDSN\0"
"PWD=gpc\0"
"UID=gpc\0");
But in my application , I need to read the values for ConnectionString
, DSN, PWD and UID from a file . This time the function does not work, I
suspect there is some problem with the "\0" . I am giving the code below :-
bool bResult = false;
CString strConnectString = "ConnectString=";
strConnectString += GPCUtility::getGUSConnectString();
strConnectString += "\\0";
CString strDSN = "DSN=";
// getting the values from a config file
strDSN += GPCUtility::getGUSDSN();
strDSN += "\\0";
CString strPWD = "PWD=";
// getting the values from a config file
strPWD += GPCUtility::getGUSPWD();
strPWD += "\\0";
CString strUID = "UID=";
// getting the values from a config file
strUID += GPCUtility::getGUSUID();
strUID += "\\0";
// CODE NOT WORKING
bResult = ::SQLConfigDataSource( NULL,
ODBC_ADD_DSN,
"Microsoft ODBC for Oracle",
strConnectString
strDSN
strPWD
strUID
);
Can anyone throw some light on it .
Thanks ,
Sujay
DISCLAIMER: Information contained and transmitted by this E-MAIL is
proprietary to Mascot Systems Limited and is intended for use only by the
individual or entity to which it is addressed, and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If this is a forwarded message, the content of this E-MAIL may not have
been sent with the authority of the Company. If you are not the intended
recipient, an agent of the intended recipient or a person responsible for
delivering the information to the named recipient, you are notified that any
use, distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at [EMAIL PROTECTED] Before opening attachments,
please scan for viruses.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]