zoukankan      html  css  js  c++  java
  • 使用ODBC备份Sqlserver数据库失败

    软件原来是使用ADO访问LocalDB,现在切换为开源ODBC的C++封装nanodbc,

    调试后其他一切正常,可BACKUP DATABASE命令虽然返回成功,但实际备份却没有成功,

    查了下资料,在微软网站上发现一个回答

    This is by design. Your application must call SQLMoreResults to ensure all the results of the statement are consumed and hence completed. BACKUP sends several messages back to the user to report progress and statistics, and SQLExecDirect returns when the first of these messages is returned. This does not mean the backup has fully completed though. Once SQLMoreResults returns SQL_NO_DATA, you can safely close the statement handle, as you've observed.

    执行BACKUP命令后必须再调用SQLMoreResults,在nanodbc不能使用just_execute,需要使用execute且调用result::next_result

  • 相关阅读:
    Windows系统结构
    Windows系统基本概念
    基本NT式驱动代码结构
    数据切割
    虚函数
    基类和派生类:谈继承
    jQuery简单的上拉加载
    检测是否为数组
    倒计时案例分析
    获得总的毫秒数
  • 原文地址:https://www.cnblogs.com/nkzhangkun/p/8011206.html
Copyright © 2011-2022 走看看