Connect to microsoft access database

import win32com.client connection = win32com.client.Dispatch(r'ADODB.Connection') DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=S://ODotor//PtoVenta//Datos//dbGesCom.mdb' connection.Open(DSN) recordset = win32com.client.Dispatch(r'ADODB.Recordset') recordset.Open('SELECT * FROM GES013 where cod = "003A"', connection, 1, 3) print (recordset.Fields.Item(8).Value) connection.Close()
This code let to connect to microsoft database access, you need to donwload win32com.client, in this moment you can donwload from this url
http://www.npackd.org/p/net.sourceforge.pywin32.PythonForWindowsExtensionsInstaller/219

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.