亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3926 | 回復(fù): 4
打印 上一主題 下一主題

在PB開發(fā)的系統(tǒng)中怎樣實(shí)現(xiàn)資料庫的備份和恢復(fù) [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-09-27 11:10 |只看該作者 |倒序?yàn)g覽
10可用積分
用PB開發(fā)的系統(tǒng),在系統(tǒng)中怎樣實(shí)現(xiàn)資料庫的備份和恢復(fù)操作,請各位大俠指點(diǎn)指點(diǎn),建議建議

最佳答案

查看完整內(nèi)容

? 可以用動態(tài)的數(shù)據(jù)窗口來實(shí)現(xiàn)將數(shù)據(jù)表中的信息存放到文本文件和dbf文件進(jìn)行備份,然后再進(jìn)行導(dǎo)入即數(shù)據(jù)恢復(fù)。具體的做法為:1、在窗口中添加一個數(shù)據(jù)窗口控件,如數(shù)據(jù)窗口控件命名為dw_pip2、在窗口中添加一個名為SAVE的保存按鈕。在SAVE按鈕中添加程序如下: string sql_syntax,dwsyntax_str string errors,S_filnam string table_name //編寫數(shù)據(jù)查尋條件 sql_syntax=查詢條件 //檢索數(shù)據(jù)窗口內(nèi)容 dwsyntax_str = ...

論壇徽章:
0
2 [報告]
發(fā)表于 2008-09-27 11:10 |只看該作者
?
可以用動態(tài)的數(shù)據(jù)窗口來實(shí)現(xiàn)將數(shù)據(jù)表中的信息存放到文本文件和dbf文件進(jìn)行備份,然后再進(jìn)行導(dǎo)入即數(shù)據(jù)恢復(fù)。具體的做法為:
1、在窗口中添加一個數(shù)據(jù)窗口控件,如數(shù)據(jù)窗口控件命名為dw_pip
2、在窗口中添加一個名為SAVE的保存按鈕。在SAVE按鈕中添加程序如下:
   string sql_syntax,dwsyntax_str
   string errors,S_filnam
   string table_name
   //編寫數(shù)據(jù)查尋條件
   sql_syntax=查詢條件
  //檢索數(shù)據(jù)窗口內(nèi)容
   dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax,"style(type=grid)" , ERRORS)
   dw_pip.Create(dwsyntax_str, ERRORS)
   dw_pip.SetTransObject(SQLCA)
   dw_pip.retrieve()       
   
   S_filnam="d:\del\test_del.txt" //要存放的文件名(自己可以設(shè)定,但必須保證該路徑存在),若存為dbf類型,則將.txt后綴改為.dbf后綴
   dw_pip.SaveAs(S_filnam, Text! , FALSE)
3、在窗口中添加名為import導(dǎo)入按鈕,在本按鈕中添加以下程序
string sql_syntax,dwsyntax_str
string errors,S_filnam

sql_syntax =要插入的數(shù)據(jù)表檢索條件
dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax,"style(type=grid)" , ERRORS)
dw_pip.Create(dwsyntax_str, ERRORS)
dw_pip.SetTransObject(SQLCA)
dw_pip.retrieve()               
//導(dǎo)入文件內(nèi)容
ii=dw_pip.ImportFile("D:\del\test_del.TXT") //文件名為SAVE按鈕中生成的文件名
dw_pip.update(true,true)
commit; //提交
4、結(jié)束,調(diào)試運(yùn)行



Top

回復(fù)人: trigger_jn(佳寶) ( ) 信譽(yù):100  2002-06-06 08:47:33Z  得分:0  


?
可以用動態(tài)的數(shù)據(jù)窗口來實(shí)現(xiàn)將數(shù)據(jù)表中的信息存放到文本文件和dbf文件進(jìn)行備份,然后再進(jìn)行導(dǎo)入即數(shù)據(jù)恢復(fù)。具體的做法為:
1、在窗口中添加一個數(shù)據(jù)窗口控件,如數(shù)據(jù)窗口控件命名為dw_pip
2、在窗口中添加一個名為SAVE的保存按鈕。在SAVE按鈕中添加程序如下:
   string sql_syntax,dwsyntax_str
   string errors,S_filnam
   string table_name
   //編寫數(shù)據(jù)查尋條件
   sql_syntax=查詢條件
  //檢索數(shù)據(jù)窗口內(nèi)容
   dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax,"style(type=grid)" , ERRORS)
   dw_pip.Create(dwsyntax_str, ERRORS)
   dw_pip.SetTransObject(SQLCA)
   dw_pip.retrieve()       
   
   S_filnam="d:\del\test_del.txt" //要存放的文件名(自己可以設(shè)定,但必須保證該路徑存在),若存為dbf類型,則將.txt后綴改為.dbf后綴
   dw_pip.SaveAs(S_filnam, Text! , FALSE)
3、在窗口中添加名為import導(dǎo)入按鈕,在本按鈕中添加以下程序
string sql_syntax,dwsyntax_str
string errors,S_filnam

sql_syntax =要插入的數(shù)據(jù)表檢索條件
dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax,"style(type=grid)" , ERRORS)
dw_pip.Create(dwsyntax_str, ERRORS)
dw_pip.SetTransObject(SQLCA)
dw_pip.retrieve()               
//導(dǎo)入文件內(nèi)容
ii=dw_pip.ImportFile("D:\del\test_del.TXT") //文件名為SAVE按鈕中生成的文件名
dw_pip.update(true,true)
commit; //提交
4、結(jié)束,調(diào)試運(yùn)行



數(shù)據(jù)庫的備份在數(shù)據(jù)庫應(yīng)用程序中是很重要的一環(huán),那么我將如何實(shí)現(xiàn)它呢?
答:用Windows的API函數(shù)可以辦到。

方法一:在PB中調(diào)用DOS命令(dbbackup.exe)備份并判斷其運(yùn)行結(jié)束。

①定義API:
    Funtion ulong FindWindowA( ulong winhandle, string wintitle ) Library "user32"
    Function boolean IsWindow (Long hwnd ) Library "user32.dll"

②腳本:
    ulong ll_handle
    int li_loop

    SetPointer(HourGlass!) //設(shè)置鼠標(biāo)指針
    //運(yùn)行備份數(shù)據(jù)庫程序dbbackup,并使其最小化
    run("dbbackup -c ~"uid=dba;pwd=sql; dbf=D:\Sybase\Adaptive Server Anywhere 6.0\asademo.db~" d:\backup", Minimized!)
    ll_handle = 0
    //循環(huán)至dbbackup窗口打開
    Do While ll_handle = 0
       ll_handle = FindWindowA("tty","dbbackup")
       yield()
    loop
    //等待dbbackup窗口關(guān)閉
    Do While isWindow(ll_handle)
       Yield()
    Loop
    //應(yīng)用執(zhí)行完成
    MessageBox("提示信息", "備份完成!")  

[注]IsWindow()函數(shù)

說明: 判斷一個窗口句柄是否有效。
返回值: Long,非零表示成功,零表示失敗。
參數(shù) 類型及說明
hwnd  Long,待檢查窗口的句柄。


http://book.77169.org/ask36/how164007.htm

論壇徽章:
0
3 [報告]
發(fā)表于 2008-09-28 09:08 |只看該作者
使用bcp如何?!

論壇徽章:
0
4 [報告]
發(fā)表于 2008-09-28 11:29 |只看該作者

回復(fù) #2 ziggler 的帖子

您好
run("dbbackup -c ~"uid=dba;pwd=sql; dbf=D:\Sybase\Adaptive Server Anywhere 6.0\asademo.db~" d:\backup", Minimized!)
上面這句能具體解釋嘛

論壇徽章:
0
5 [報告]
發(fā)表于 2008-09-28 12:48 |只看該作者
原帖由 admin8776 于 2008-9-28 11:29 發(fā)表
您好
run("dbbackup -c ~"uid=dba;pwd=sql; dbf=D:\Sybase\Adaptive Server Anywhere 6.0\asademo.db~" d:\backup", Minimized!)
上面這句能具體解釋嘛

dbbackup   [   switches   ]   directory  
   
  Switch  
    Description  
     
  -c   "keyword=value;   ..."   
    Supply   database   connection   parameters  
     
  -d  
    Only   back   up   the   main   database   file  
     
  -l   file  
    Live   backup   of   the   transaction   log   to   a   file  
     
  -n  
    Change   the   naming   convention   for   the   backup   transaction   log  
     
  -o   filename  
    Log   output   messages   to   a   file  
     
  -q  
    Quiet   mode—do   not   print   messages  
     
  -r  
    Rename   and   start   a   new   transaction   log  
     
  -t  
    Only   back   up   the   transaction   log  
     
  -w  
    Only   back   up   the   write   file  
     
  -x  
    Delete   and   restart   the   transaction   log  
     
  -xo  
    Delete   and   restart   the   transaction   log   without   making   a   backup  
     
  -y  
    Replace   files   without   confirmation  
     
   
   
  Description   
  If   none   of   the   switches   -d,   -t,   or   -w   are   used,   all   database   files   are   backed   up.  
   
  For   more   information   about   the   command-line   switches,   see   Backup   utility   options.

http://topic.csdn.net/t/20010918/08/291299.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP