Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/03/2004, 12:33
ANELLITA
 
Fecha de Ingreso: marzo-2004
Ubicación: MEXICO DF
Mensajes: 9
Antigüedad: 21 años
Puntos: 0
RECUPERACION DE DATOS

Hola ¡!

Mira te envio mi codigo de la consulta, donde de mi db la columna Reporte es una columna autonumerica, y supongo que es por ahi el problemita, ayuda por favor.

Te lo agradecere muchisimo

Saluditos ¡!

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Label4.Text = ""
Cargar_Datos_DataReader()
End If
End Sub
Private Sub Cargar_Datos_DataReader()
Dim objconexion As OleDbConnection
Dim objComando As OleDbCommand
Dim objDataReader As OleDbDataReader
objconexion = New OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0. ;DATA SOURCE=" & Server.MapPath("\apps\libro\bd1.mdb"))
objconexion.Open()
objComando = New OleDbCommand("Select Reporte, Nombre From gbc2 Where Reporte = '" & TextBox1.Text & "'", objconexion)
objDataReader = objComando.ExecuteReader()
objDataReader.Read()
objDataReader.Close()
objconexion.Close()
End Sub

Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Acceder_Info_DataReader(TextBox1.ReadOnly.ToString )
End Sub

Private Function Acceder_Info_DataReader(ByVal Id As String)
Dim objConexion As OleDbConnection
Dim objComando As OleDbCommand
Dim objDataReader As OleDbDataReader
Dim report As String
report = TextBox1.Text
objConexion = New OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0. ;DATA SOURCE=" & Server.MapPath("\apps\libro\bd1.mdb"))
objConexion.Open()
objComando = New OleDbCommand("Select Nombre from gbc Where Reporte = '" & TextBox1.Text & "'", objConexion)
objDataReader = objComando.ExecuteReader()
objDataReader.Read()
While objDataReader.Read
With Label4.Text
Label4.Text = TextBox1.ReadOnly.ToString
Label4.Text = (objDataReader("Nombre"))
End With
End While
objDataReader.Close()
objConexion.Close()
End Function

End Class