<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div id="yiv5232955992" style="font-size: 16.363636016845703px;"><div><div class="yiv5232955992yui_3_13_0_1_1383724147849_5642 yui_3_13_0_1_1383724147849_8000" style="font-size: 10pt;"><div>Ciao a tutti!</div><div>Ho un piccolo problema nell'esecuzione di una query sql (sqlserver) tramite win32com.client ADODB.</div><div>Fondamentalmente mi da l'errore "Il nome di colonna 'None' non è valido" e non capisco perché non gli vada bene passargli None come valore nullo.</div><div>Forse è un problema della funzione format che uso? Dovrei usare il classico sistema "%s %s" %(var1,var2) ?</div><div><br clear="none"></div><div>Stringa di creazione della Query:</div><div>query= "INSERT INTO dbo.IM_WorkingReports " \</div><div><span style="font-size: 10pt;">
"VALUES ( {r.WorkingReportId}, {r.WorkingReportNo}, {r.WorkingReportDate}, {r.PostingDate}, {r.Customer}, '{r.Payment}', {r.PostedToAccounting}, {r.Issued}, {r.Posted}, {r.Printed}, " \</span><br clear="none"></div><div> "{r.InvoiceFollows}, '{r.WRReason}', '{r.StubBook}', {r.Job}, {r.PostedToCostAccounting}, {r.WorkingReportType}, {r.LabourHourlyRate}, {r.CallServiceCost}, {r.DNId}, {r.DNNo}, " \</div><div> "{r.PriceList}, {r.CustomerBank}, {r.CompanyBank}, {r.AccTpl}, {r.TaxJournal}, {r.CallService}, {r.Labour}, {r.Description}, {r.InvRsn}, {r.StorageStubBook}, {r.StoragePhase1}," \</div><div> "{r.StoragePhase2}, {r.SpecificatorPhase1},
{r.SpecificatorPhase2}, {r.SaleDocGenerated}, {r.PostedToInventory}, {r.EntryId}, {r.BalanceFromEmployeesTab}, {r.BalanceFromActualitiesTab}, " \</div><div> "{r.Currency}, {r.FixingDate}, {r.Fixing}, {r.FixingIsManual}, {r.WorkingReportTypology}, {r.Employee}, {r.Qualification}, {r.ExternalReference}, " \</div><div> "'{r.TBCreated}', '{r.TBModified}', {r.TBCreatedID}, {r.TBModifiedID} );".format(r=record)</div><div><br clear="none"></div><div class="yiv5232955992yui_3_13_0_1_1383724147849_5644 yui_3_13_0_1_1383724147849_8002" style="background-color: transparent;">record è un oggetto i cui metodi vengono riempiti e poi passati alla query</div><div class="yiv5232955992yui_3_13_0_1_1383724147849_5645 yui_3_13_0_1_1383724147849_8003" style="background-color: transparent;"><br
clear="none"></div><div style="background-color: transparent;">Query:</div><div style="background-color: transparent;">INSERT INTO dbo.IM_WorkingReports ( WorkingReportId, WorkingReportNo, WorkingReportDate, PostingDate, Customer, Payment, PostedToAccounting, Issued, Posted, Printed, InvoiceFollows, WRReason, StubBook, Job, PostedToCostAccounting, WorkingReportType, LabourHourlyRate, CallServiceCost, DNId, DNNo, PriceList, CustomerBank, CompanyBank, AccTpl, TaxJournal, CallService, Labour, Description, InvRsn, StorageStubBook, StoragePhase1,StoragePhase2, SpecificatorPhase1, SpecificatorPhase2, SaleDocGenerated, PostedToInventory, EntryId, BalanceFromEmployeesTab, BalanceFromActualitiesTab, Currency, FixingDate, Fixing, FixingIsManual, WorkingReportTypology, Employee, Qualification, ExternalReference, TBCreated, TBModified, TBCreatedID, TBModifiedID) VALUES ( 6775, 5022, 20131014, 2013-11-06, 0046, 'R601-10', 0, 1, 1, 0, 1, 'ECO', 'PR', 12/00006,
0, 65536001, 0, 0, 0, None, None, 02008-61840, 01, FE, VEN, None, None, None, I-CIRAP, None, SEDE,None, None, None, 0, 1, 4069, 1, 1, None, -36523, 0, 0, 19333120, None, None, None, '2013-11-06 07:49:48+00:00', '2013-11-06 07:49:48+00:00', 2, 2 ); </div><div style="background-color: transparent;">Eccezione:</div><div style="background-color: transparent;"> (-2147352567, 'Eccezione.', (0, 'Microsoft OLE DB Provider for ODBC Drivers', "[Microsoft][ODBC SQL Server Driver][SQL Server]Il nome di colonna 'None' non è valido.", None, 0, -2147217900), None)</div><div style="background-color: transparent;"><br clear="none"></div><div class="yiv5232955992yui_3_13_0_1_1383724147849_5651 yui_3_13_0_1_1383724147849_8009" style="background-color: transparent;">Grazie per l'aiuto</div><div class="yiv5232955992yui_3_13_0_1_1383724147849_5652 yui_3_13_0_1_1383724147849_8010" style="background-color: transparent;">Piergiorgio</div></div></div></div><div><br
clear="none" style="font-size: 16.363636016845703px;"></div></div></body></html>