VC6.0中,ADODC控件如何单纯用代码设置... 环境:VC6.0 SQL SERVER 2000 我新建立了一个程序..
在窗体上面添加2个控件..
一个 Adodc 一个 DataGrid
Adodc控件没设置...DataGrid控件数据源设置为Adodc控件.. 在窗体的OnInitDialog()函数里面添加下列代码:
m_adodc.SetConnectionString("Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=HrSys;Data Source=127.0.0.1");
m_adodc.SetRecordSource("SELECT * FROM Departments");
m_adodc.Refresh(); 为何程序运行之后DataGrid无法显示表中内容的...
创建一个程序->添加一个 Adodc 一个 DataGrid ->DataGrid 数据源设置为ADODC-->ADODC控件不设置->在程序里面用代码设置连接语句....
谁能用代码设置ADODC控件,让DataGrid 显示 谁能够这样的 把添加的代码 放在哪个位置 详细的说下 谢谢..
在窗体上面添加2个控件..
一个 Adodc 一个 DataGrid
Adodc控件没设置...DataGrid控件数据源设置为Adodc控件.. 在窗体的OnInitDialog()函数里面添加下列代码:
m_adodc.SetConnectionString("Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=HrSys;Data Source=127.0.0.1");
m_adodc.SetRecordSource("SELECT * FROM Departments");
m_adodc.Refresh(); 为何程序运行之后DataGrid无法显示表中内容的...
创建一个程序->添加一个 Adodc 一个 DataGrid ->DataGrid 数据源设置为ADODC-->ADODC控件不设置->在程序里面用代码设置连接语句....
谁能用代码设置ADODC控件,让DataGrid 显示 谁能够这样的 把添加的代码 放在哪个位置 详细的说下 谢谢..
m_adodc.SetConnectionString("Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=HrSys;Data Source=127.0.0.1");
m_adodc.SetRecordSource("SELECT * FROM Departments");
m_adodc.Refresh(); 运行之后老是不行...
CString strConn;
strConn.Format(_T("Provider=SQLOLEDB.1;Persist Security Info=True;User ID=%s;Password=%s;Initial Catalog=HrSys;Data Source=127.0.0.1"), m_strUser, m_strPassword);
m_adodc.SetConnectionString(m_strConn);
...
创建一个程序->添加一个 Adodc 一个 DataGrid ->DataGrid 数据源设置为ADODC-->ADODC控件不设置->在程序里面用代码设置连接语句....
不过哪些语句要放在程序里面的什么地方的??我放在OnInitDialog()里面,可是不行,设置了后没反应
麻烦 把具体添加的代码 放在哪个位置 说下 谢谢..
是否设置了ADODC的ConnectionString还有RecordSource之后, DataGrid 控件也要设置下的...
如果是 ,请问怎么设置...