select @str= 'SELECT SELECT * INTO #TMP1 FROM openrowset( '+ ' ' 'MSDASQL ' ', ' 'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB= '+ @path + ' ' ', ' 'select * from [ '+ @tablename + '] ' ' '+ ') '+
'INSERT INTO D_ML_CGML_SUB SELECT * FROM #TMP1 '+
' drop table #TMP1 '
exec (@str)
出错。.net抛出异常如下,怎么解决,多谢
该操作未能执行,因为 OLE DB 提供程序 'MSDASQL ' 无法启动分布式事务。 [OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPro Driver]Driver not capable]
------解决方案--------------------------------------------------------
select * into 要生成的SQL表名 from openrowset( 'MSDASQL ', 'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:\ ', 'select * from dbf表名.DBF ')
------解决方案--------------------------------------------------------
1、运行环境,你是在SQL SERVER中吧;
2、SQL语句有问题,两个SELECT,
select * from openrowset( 'VFPOLEDB.1 ', 'd:\temp\dd.dbf '; 'admin '; ' ' , 'select * from dd ')