2007年07月17日 星期二 10:25
找到了GetChunk和AppendChunk,還是不知道怎么用!
誰能指教?
01. import pythoncom
02. import win32com.client
03.
04. try:
05. objConn = win32com.client.Dispatch(r'ADODB.Connection')
06. objConn.Open(r"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/db1.mdb")
07.
08. objRS = win32com.client.Dispatch(r'ADODB.Recordset')
09. objRS.Open('SELECT id,photo FROM [user]',objConn,1,3)
10. objRS.MoveFirst()
11.
12. sz = objRS.Fields.Item('photo').ActualSize
13. objRS.Fields.Item('photo').GetChunk(sz)
14. #????????????
15. except pythoncom.com_error, (hr, msg, exc, n):
16. print 'com error'
----- 原始邮件 ----
发件人: 汪文进 <wjawon在yahoo.com.cn>
收件人: python-chinese在lists.python.cn
已发送: 2007/7/16(周一), 下午4:06:10
主题: [python-chinese] pywin32中如何存取二進制大對象
請教各位,在pywin32中如何存取二進制大對象(ADO)?
以前在C中用Field對象的GetChunk和AppendChunk方法,在pywin32中有沒有類似的方法?
現在我要將AutoCAD文件(或別的文件)存入/讀出數據庫,
哪位有空能給我一個源碼來說明,比如:
def AppendChunk(FieldName,FileName):
...
def Getchunk(FieldName):
...
謝謝!
(win2k + python2.5 + pywin32-210)
雅虎免费邮箱3.5G容量,20M附件!
_______________________________________________
python-chinese
Post: send python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese
___________________________________________________________
抢注雅虎免费邮箱3.5G容量,20M附件!
http://cn.mail.yahoo.com
-------------- 涓嬩竴閮ㄥ垎 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20070717/cfc34888/attachment.html
2007年07月17日 星期二 10:34
On 7/17/07, 汪文进 <wjawon在yahoo.com.cn> wrote: > > 找到了GetChunk和AppendChunk,還是不知道怎么用! > 誰能指教? > 这有实例 http://blog.daviesliu.net/article/entry20050518-192847 > 01. import pythoncom > 02. import win32com.client > 03. > 04. try: > 05. objConn = win32com.client.Dispatch(r'ADODB.Connection') > 06. objConn.Open(r"Provider=Microsoft.Jet.OLEDB.4.0;Data > Source=d:/db1.mdb") > 07. > 08. objRS = win32com.client.Dispatch(r'ADODB.Recordset') > 09. objRS.Open('SELECT id,photo FROM [user]',objConn,1,3) > 10. objRS.MoveFirst() > 11. > 12. sz = objRS.Fields.Item('photo').ActualSize > 13. objRS.Fields.Item('photo').GetChunk(sz) > 14. #???????????? > 15. except pythoncom.com_error, (hr, msg, exc, n): > 16. print 'com error' > > > > > > > > > ----- 原始邮件 ---- > 发件人: 汪文进 <wjawon在yahoo.com.cn> > 收件人: python-chinese在lists.python.cn > 已发送: 2007/7/16(周一), 下午4:06:10 > 主题: [python-chinese] pywin32中如何存取二進制大對象 > > > > > 請教各位,在pywin32中如何存取二進制大對象(ADO)? > > 以前在C中用Field對象的GetChunk和AppendChunk方法,在pywin32中有沒有類似的方法? > 現在我要將AutoCAD文件(或別的文件)存入/讀出數據庫, > 哪位有空能給我一個源碼來說明,比如: > > def AppendChunk(FieldName,FileName): > ... > > def Getchunk(FieldName): > ... > > 謝謝! > (win2k + python2.5 + pywin32-210) > ________________________________ > 雅虎免费邮箱3.5G容量,20M附件! > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > ________________________________ > 抢注雅虎免费邮箱3.5G容量,20M附件! > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- '''Time is unimportant, only life important! http://zoomquiet.org blog在http://blog.zoomquiet.org/pyblosxom/ wiki在http://wiki.woodpecker.org.cn/moin/ZoomQuiet scrap在http://floss.zoomquiet.org douban在http://www.douban.com/people/zoomq/ ____________________________________ Pls. use OpenOffice.org to replace M$ Office. http://zh.openoffice.org Pls. use 7-zip to replace WinRAR/WinZip. http://7-zip.org/zh-cn/ You can get the truely Freedom 4 software. '''
Zeuux © 2025
京ICP备05028076号