Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2010, 15:46
rikimm
 
Fecha de Ingreso: agosto-2008
Ubicación: D,F
Mensajes: 412
Antigüedad: 15 años, 8 meses
Puntos: 4
error en el query

tengo error en el query en el siguiente codigo me dice que mi erro esta en el insert
poque lo tengo mal si esta bien definido
Código vb:
Ver original
  1. If TextBox1.Text = "Nombre" Or TextBox2.Text = "Nombre 2" Or TextBox3.Text = "Apellido" Or TextBox4.Text = "Apellido2" Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Then
  2.             MessageBox.Show("No has metido los datos correctos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
  3.         Else
  4.             Dim nom, Snom, ape, Sape As String
  5.             Dim dd, mm, aaaa As String
  6.             Dim usuario, pass As String
  7.             Dim status As String
  8.             Dim x As String
  9.             nom = TextBox1.Text(0)
  10.             Snom = TextBox2.Text(0)
  11.             ape = TextBox3.Text(0)
  12.             Sape = TextBox4.Text(0)
  13.             dd = TextBox5.Text
  14.             mm = TextBox6.Text
  15.             aaaa = TextBox7.Text(2) + TextBox7.Text(3)
  16.             usuario = nom + Snom + ape + Sape + aaaa.ToString()
  17.             pass = aaaa.ToString() + mm.ToString() + dd.ToString() + Snom + ape
  18.             status = ComboBox1.Text
  19.             Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\riki\Documents\Visual Studio 2008\Projects\SistemaDP\SistemaDP\bin\Debug\doggyp.mdb")
  20.             Dim ds As New OleDbCommand
  21.             Dim sql As String
  22.             cnn.Open()
  23.             ds.Connection = cnn
  24.             ds.CommandType = CommandType.Text
  25.             sql = "INSERT INTO Usuarios(pass,estatus,user)"
  26.             sql = sql + "Select '" & pass & "','" & status & "','" & usuario & "';"
  27.             ds.CommandText = sql
  28.             x = ds.ExecuteNonQuery()
__________________
Si el amor a una mujer es igual al amor a la programacion
cual de las dos escojerias...mmmm buena pregunta jejeje