Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/03/2010, 09:09
Mayra_Manrique
 
Fecha de Ingreso: noviembre-2008
Ubicación: Ecuador
Mensajes: 3
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: consulta de SQL desde Vb 6.0

Dim DB As Connection
Set DB = New Connection
DB.CursorLocation = adUseClient
DB.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=127.0.0.1;" _
& " DATABASE=agencia_viajes;" _
& "UID=root;PWD=q; OPTION=3"
DB.Open
Set adoprimaryrs = New Recordset
adoprimaryrs.Open "SELECT t.cedula, t.nombres, t.apellidos, h.ciudad, h.hotel From turista t, hospedaje h Where t.cedula= '" & Text1.Text & "' and h.cedula= '" & Text1.Text & "'", DB, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoprimaryrs
End Sub

hay esta todo para que se entienda mejor....... y si existen registros con esos datos si pueden ayundenme porfa!!!!!!!!!!!!