如题,现要从配置文件中读数据库的属性,动态填入,如何实现啊??
CDBPropSet dbinit(DBPROPSET_DBINIT);
dbinit.AddProperty( DBPROP_AUTH_PASSWORD, "scott");
dbinit.AddProperty(DBPROP_AUTH_USERID, "scott" );
dbinit.AddProperty(DBPROP_INIT_CATALOG, "DBPro");
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, "Net_DBPro");
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
dbinit.AddProperty(DBPROP_INIT_TIMEOUT, (short)20); HRESULT hr = objConnect-> Open( "MSDASQL", &dbinit); 就是把用户名,密码,数据源等用变量表示,请高手赐教!!
PS:用char aa[30]就连不上
CDBPropSet dbinit(DBPROPSET_DBINIT);
dbinit.AddProperty( DBPROP_AUTH_PASSWORD, "scott");
dbinit.AddProperty(DBPROP_AUTH_USERID, "scott" );
dbinit.AddProperty(DBPROP_INIT_CATALOG, "DBPro");
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, "Net_DBPro");
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
dbinit.AddProperty(DBPROP_INIT_TIMEOUT, (short)20); HRESULT hr = objConnect-> Open( "MSDASQL", &dbinit); 就是把用户名,密码,数据源等用变量表示,请高手赐教!!
PS:用char aa[30]就连不上
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货