KAO...把文件打開模式改成ForAppending就好了嘛。笨!Declare @ForAppending int
SET @ForAppending=8EXEC @hr = sp_OAMethod @object, 'OpenTextFile', @tmp OUTPUT , @strPath,@ForAppending--以後如果得這文件里寫東西的話,就是在最後面增加的。
SET @ForAppending=8EXEC @hr = sp_OAMethod @object, 'OpenTextFile', @tmp OUTPUT , @strPath,@ForAppending--以後如果得這文件里寫東西的話,就是在最後面增加的。
Declare @ForAppending int
SET @ForAppending=8EXEC @hr = sp_OAMethod @object, 'OpenTextFile', @tmp OUTPUT , @strPath,@ForAppending怎么执行错误呢?请指教!
你這個錯誤估計不是由這一條語句造成的,可能是由於後面的語句造成的。
可以這樣測試:Declare @ForAppending int
SET @ForAppending=8EXEC @hr = sp_OAMethod @object, 'OpenTextFile', @tmp OUTPUT , @strPath,@ForAppending
IF @hr<>0
print '錯誤發生在這'