>Not really a pywin32 related by I will bite :) >For every iteration of the while loop you have to create a new >dictionary, fill it up with data and append to the list.
I posted here because this has never happened to me before, only with the COM object thrown in does it do this. So I assumed it was some kind of windows COM issue. >> >> here is that portion of the code: >> >> prv640_records = [] >> while not rtn.EOF: >> prv640_dic = {} >> prv640_dict['promise_id'] = rtn.Fields.Item('promise_id').Value >> prv640_dict['service_location'] = >> rtn.Fields.Item('service_location').Value >> prv640_dict['mco_code'] = rtn.Fields.Item('subnetwork_id').Value >> prv640_dict['begin_date'] = rtn.Fields.Item('begin_date').Value >> prv640_dict['end_date'] = rtn.Fields.Item('end_date').Value >> prv640_dict['mco_prov_number'] = rtn.Fields.Item('provider_id').Value >> prv640_dict['action'] = rtn.Fields.Item('STATUS').Value >> >> rtn.MoveNext() >> prv640_records.append(prv640_dict) >> I made this work by adding prv640_dict = None after the list append. >It really is the same dictionary referenced 402 times. >In a debugger type >>> id(prv640_records[0]), d(prv640_records[1]) >It will display two identical identifiers. As soon as I get in the office I will check this out. >Also I would recommend using adodbapi or pyodbc module for talking to >SQL Server. >adodbapi is already included in pywin32 distribution. >The API of both those extensions follow DBAPI 2 >http://www.python.org/dev/peps/pep-0249/ >Much nicer IMHO. I looked at this a few years ago but for me it was easier to use COM with stored procedures, but I will look at it again. Thanks Rod Waldemar _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32