日期:2014-05-18  浏览次数:20514 次

关于超时已过期的问题,请高手解惑!

VB运行下面代码,在运行到恢复帐套时,总是弹出“超时已过期”的提示,而在查询分析器中执行相同的sql 语句是可以正常执行的。我已经把ConnectionTimeout=0 还是不行,这个问题该怎么解决。在线等。

  Label1.Caption = "正在拆分帐套请耐心等待..."
  DoEvents
  strCreat = "BACKUP DATABASE MHPS TO DISK='D:\BACKUP'; "
  g_adoConn.Execute strCreat
   
   
  strCreat = " CREATE DATABASE [" & Combo1.Text & "] ON ..."
  g_adoConn.Execute strCreat
  Label1.Caption = "帐套备份成功..."
  DoEvents
   
  strCreat = " RESTORE DATABASE [" & Combo1.Text & "] FROM DISK = 'd:\BACKUP' ..."
  g_adoConn.Execute strCreat
  Label1.Caption = "帐套恢复成功..."
  DoEvents
   
  strCreat = " Delete [" & Combo1.Text & "]..m_curcardinfo ; "
  strCreat = strCreat & " Delete [" & Combo1.Text & "]..m_mcardinfo "
  g_adoConn.Execute strCreat
  Label1.Caption = "数据清理成功..."
  DoEvents



------解决方案--------------------
一般執行多長時間,跳出提示?
------解决方案--------------------
......