Following code is written in cpp, this code connects to db and brings a value set by the filters. This code is used in a application exe. Everything is working fine but when it goes to open block in application it pops a sql server login box , after putting the details it works as expected. The code links to many db tables and many ways all functinalities wrk fine widout askin fr username/paswd, only this fxn is asking, hw to prevent it.
CConnection *dbase2;
dbT_VOY tT_VOY(dbase2);
CString csFilter;
cout<<"the enetered voyage number is "<<voy<<endl;
cout<<"the vessel code is "<<ves<<endl;
csFilter.Format("VESSEL='%s' and VOY_NUMBER='%s'",ves,voy);
cout<<csFilter<<endl;
tT_VOY.setFilter(csFilter);
tT_VOY.Open(CRecordset::forwardOnly, CRecordset::readOnly | CRecordset::executeDirect);
if(!tT_VOY.IsEOF())
{procedure}
tT_VOY.Close
No error in compilation The tT_VOY.Open block when comes in execution, asks for DB password and username through "SQL SERVER LOGIN". HOW IT CAN BE PREVENTED. Other DB instances working fine in the same file.
COnnection pool is implenmented as
g_connectionPoolRead.init("DSN=GSISRead;UID=gsisuser;PWD=appl;APP=SRV_Voyage",
CDatabase::useCursorLib, 10);
g_connectionPoolRead.setLoginTimeout(180);
g_connectionPoolRead.setQueryTimeout(240);
//Just a part from pool. The Dbaccess is defined as
BOOL Open(UINT nOpenType, DWORD dwOptions=CRecordset::none);
The Db instance is made as
class dbT_VOY : public DBAccess
{
public:
dbT_VOY::dbT_VOY(CDatabase* pdb) : DBAccess(pdb)
{
fields = new Cfields();
fields->Add(myDBField("Voy_Number"));
m_strTable="T_VOY";
}
};
Also the connection *dbase2 is used because CConnection *dbase = NULL; is done in code above it, the same is not working if null is removed too. so new is made. Al wrks fine but it pops a login box, fr databse, if correct details are used it wrks fine as expected. The dialogue box shouldn't come from the db. Other instances and functions too use the same pattern for linkin to db and they wrk widout any dialogue box. Please help to remove this box or automate the usename paswd for the same.??