Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/07/2012, 20:34
poeta3d
 
Fecha de Ingreso: diciembre-2010
Mensajes: 162
Antigüedad: 13 años, 5 meses
Puntos: 1
Pregunta problema con sqlite3

tengo este codigo

Código Python:
Ver original
  1. import wx
  2. import sqlite3
  3.  
  4. class sqlite(wx.Frame):
  5.     def __init__(self,parent):
  6.         wx.Frame.__init__(self,parent,size=(500,400))
  7.         self.Show()
  8.        
  9.  
  10.         self.label=wx.StaticText(self,label="nombre",pos=(100,100))
  11.         self.texto=wx.TextCtrl(self,pos=(150,100))
  12.  
  13.         self.label2=wx.StaticText(self,label="apellido",pos=(100,150))
  14.         self.texto2=wx.TextCtrl(self,pos=(150,150))
  15.  
  16.         self.boton=wx.Button(self,label="mostrar",pos=(200,200))
  17.  
  18.         self.Bind(wx.EVT_BUTTON, self.onboton)
  19.     def onboton(self,event):
  20.         x=self.texto.GetValue()
  21.         conexion=sqlite3.connect("nombres.S3DB")
  22.         cursor=conexion.cursor()
  23.         t=(x, )
  24.         cursor.execute("SELECT * FROM nombre WHERE id=?",t)
  25.         for row in cursor:
  26.             self.texto2.SetValue(row[0])
  27.  
  28. app=wx.App()
  29. s=sqlite(None)
  30. app.MainLoop()

y me sale este error
Traceback (most recent call last):
File "D:\PROYECTOS PYTHON\WXPYTHONSQLITE.pyw", line 24, in onboton
cursor.execute("SELECT * FROM nombre WHERE id=?",t)
sqlite3.DatabaseError: file is encrypted or is not a database

y no se a que se refiere, no se que esta mal, por favor si podrian ayudarme con esto

Última edición por razpeitia; 30/07/2012 a las 10:37