日期:2014-05-20  浏览次数:20716 次

c#.net中用odbc连接,为何动态创建dbf文件不成功
在.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.dbf
------解决方案--------------------
关注

------解决方案--------------------
create table [test14.dbf](sno c(6),sname c(10),age n(3,0))