rickey kyle w omwoerbknrbakerhughescom ive got several excel sheets would like run sql queries ive worked couple ways im sure best way would ive also got problem cant connect excel file someone currently editing given following code samples one better guess im asking odbc ado connection better import odbc win32comclient file cfilexls search_term test example 1 conn_string drivermicrosoft excel driver xlsdbqfilereadonlytrueimex1 conn odbcodbcconn_string cur conncursor curexecuteselect f5 f6 f7 f1 excel 80hdryesimex1databasefilesheet1bh lcasef6 like search_termlower rec curfetchall example 1 example 2 try conn win32comclientdispatchadodbconnection dsn rprovidermicrosoftjetoledb40 data sourcefile extended propertiesexcel 80 readonlytrue imex1 connopendsn except win32comclientpywintypescom_errorsomeone editing file file2 ctempxls ospathexistsfile2 osremovefile2 shutilcopy2file file2copy file c read file file2 conn win32comclientdispatchadodbconnection dsn rprovidermicrosoftjetoledb40 data sourcefile extended propertiesexcel 80 readonlytrue imex1 connopendsn else rec rs win32comclientdispatchadodbrecordset rs_name myrecordset rsopenselect excel 80 hdryes imex1 databasefilesheet1bh lcasef6 like search_termlower conn rseof lst lstappendrsfieldsitemf5value lstappendrsfieldsitemf6value lstappendrsfieldsitemf7value lstappendrsfieldsitemf1value recappendlst rsmovenext example 2 kyle rickey _______________________________________________ pythonwin32 mailing list kpitckaew45pythonorg httpmailpythonorgmailmanlistinfopythonwin32 wed 06 aug 2008 030235 0500 pythonwin32 running sql queries excel sheets