The Sybase libraries (the C-level ones, not the python ones) use
"errors" to communicate all kinds of things (like database names after
"use database"). Catch the exception and check for message
3216. Since it's a known message, you can ignore it.<br>
<br>
-Chris<br>
<br>
P.S. Of course, you'll need to be sure that you won't need to
signal a volume change during the backup, becase you need the
information in the message to be able to do that properly.<br><br><div><span class="gmail_quote">On 11/25/05, <b class="gmail_sendername">Wang King</b> <<a href="mailto:wangkknd@gmail.com">wangkknd@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Sybase Module for python had been installed successful.<br>My commands like this:
<br><font style="background-color: rgb(102, 255, 255);">>>> from Sybase import *<br>>>> a = connect('SYBASE','sa','')<br>>>> a
</font><br><Sybase.Connection instance at 0x0093BBC0><br><br><font style="background-color: rgb(102, 255, 255);">>>> cur = a.cursor()<br>>>> cur</font><br><Sybase.Cursor instance at 0x00934350>
<br><font color="#000000">
<font style="background-color: rgb(51, 255, 255);">>>> cur.execute('dump database test to "c:\\test" ')</font><br></font><br>The result like this:<br><br><font style="background-color: rgb(255, 153, 102);">
Traceback (most recent call last):
<br> File "<stdin>", line 1, in ?<br> File "D:\Python24\Lib\site-packages\Sybase.py", line 764, in execute<br> self.description = fetcher.start(self.arraysize)<br> File "D:\Python24\Lib\site-packages\Sybase.py", line 515, in start
<br> return self._start_results()<br> File "D:\Python24\Lib\site-packages\Sybase.py", line 619, in _start_results<br> status, result = self._cmd.ct_results()<br> File "D:\Python24\Lib\site-packages\Sybase.py", line 200, in _servermsg_cb
<br> raise DatabaseError(_fmt_server(msg))<br>Sybase.DatabaseError: Msg 3216, Level 10, State 1, Line 1<br>Backup Server session id is: 47. Use this value when executing the 'sp_volchan<br>ged' system stored procedure after fulfilling any volume change request from the
<br>Backup Server.<br>Msg 404101, Level 1, State 1, Procedure bs_write_header<br>Backup Server: <a href="http://4.41.1.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">4.41.1.1</a>: Creating new disk file c:\test.
</font></div>
<div><font style="background-color: rgb(255, 153, 102);"></font> </div>
<div><font style="background-color: rgb(255, 255, 255);">But the database has been dumped successful.</font></div>
<div> </div>
<div>How can I dump database by python?</div>
<br>_______________________________________________<br>Python-sybase mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Python-sybase@www.object-craft.com.au">Python-sybase@www.object-craft.com.au
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase" target="_blank">https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase
</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Nervous passengers are advised to wear a blindfold.