SQLUpdateCommand = ("Update prodtbl set CompanyAddress=?, UserName=?, FromEmailAddress=?, paswrd=? WHERE CompanyName=?")
Values = [CompanyName, CompanyAddress, UserName, FromEmailAddress, paswrd, CompanyName]
print("Upto Here It executes Successfully. After this it fails..!<br/>")
cursor.execute(SQLUpdateCommand,Values)
cnxn.commit()
以上值分配给各自的变量
由于CompanyName重复两次。所以发生错误。
在下面的打印语句后,代码导致错误
如何捕获异常并打印出相同的异常?