怎样判断有没有打开和数据库的连接
gxz01 2003-07-25 05:52:32 我相判断有没有打开这个连接,如果没有找到这个文件就返回,但
下面的代码好向不管用.
string strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\\pcadex.v31\\adreport\\zxg\\hk\\SectionCode.mdb";
SectionCodeConnection=new OleDbConnection(strConn);
if(SectionCodeConnection==null)
{
MessageBox.Show("打开文件错误.");
return;
}
SectionCodeConnection.Open();