I'm looking for the mapping table / logic that will render sql server timestamp values as win32com.client does.
I'm currently importing a text file into Access. The text file contains a column with a timestamp value which has been extracted from sql server. The values for the (Access String 50) column look something like " 0x000000000189CF01". Using VBA I want to convert these to the exact same value that win32com creates. In python (sample code below) the timestamp value is stored as an 8 byte, bytearray. Which then gets interpreted by Access. Below is a sample of how the sql server timestamp value is stored in Access: *SQL Server (Timestamp) | Access (Text 50)* 0x000000000189CF01 | 003F49 0x000000000189D001 | 003F69 0x0000000001B54DFF | 003F6D 0x0000000001F74701 | 003F4E 0x000000000189C003 | 003F70 So it tries to do a mapping, sometimes 1 to 1, sometimes not as page 5 of the below link demonstrates https://scripts.sil.org/cms/scripts/render_download.php?format=file&media_id=UnicodeWord&filename=unicodeissuesinword97-2000.pdf I'd appreciate it if anyone has logic or a link to the mapping tables. *Sample Python code * MSAccessconnect = 'Driver={Microsoft Access Driver (*.mdb)};Dbq=test.mdb;' SQLServerconnect = '[ODBC;Driver=SQL Server;SERVER=server1;Database=test;UID=%s;PWD=%s]' %('user', 'pass') strsql = "SELECT * FROM %s.%s;" % (SQLServerconnect, "sqltesttable") print strsql from win32com.client import Dispatch oConn = Dispatch('ADODB.Connection') oConn.ConnectionString = MSAccessconnect oConn.Open() oRS = Dispatch('ADODB.RecordSet') oRS.ActiveConnection = oConn oRS.Open(strsql) while not oRS.EOF: print oRS.Fields.Item("Stamp").Value The text displayed is ▒▒▒
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32