在.NET中数据用ODBC连接,为什么不能创建DBF文件,
源代码如下:(调试成功,运行没提示错误,就是没生成test14.dbf.
string connect = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\\;";
OdbcConnection myconn = new OdbcConnection(connect);
string sqlt = "create table [test14.dbf](sno char(6),sname char(10),age numeric(3,0)) ";
myconn.Open();
OdbcCommand olec = new OdbcCommand(sqlt, myconn);
try
{
olec.ExecuteNonQuery(); }
catch (Exception ex)
{
Response.Write(ex.ToString());
}
olec.Dispose();
myconn.Close();
源代码如下:(调试成功,运行没提示错误,就是没生成test14.dbf.
string connect = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\\;";
OdbcConnection myconn = new OdbcConnection(connect);
string sqlt = "create table [test14.dbf](sno char(6),sname char(10),age numeric(3,0)) ";
myconn.Open();
OdbcCommand olec = new OdbcCommand(sqlt, myconn);
try
{
olec.ExecuteNonQuery(); }
catch (Exception ex)
{
Response.Write(ex.ToString());
}
olec.Dispose();
myconn.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货