| |||
Respuesta: Access fin Así es como me conecto MODULE Dim cnn As New OleDb.OleDbConnection Public Function conectar() As OleDb.OleDbConnection Try Dim ruta As String ruta = Application.StartupPath & "\" & "empresa.accdb" If cnn.State = 1 Then cnn.Close() cnn.ConnectionString = "provider = microsoft.Ace.Oledb.12.0; data source = '" & ruta & "'" cnn.Open() Return cnn Catch ex As Exception MessageBox.Show(Err.Description) Return Nothing End Try End Function Microsoft.Jet.OLEDB.4.0 En el formulario Dim objConexion As New OleDb.OleDbConnection Dim objcomando As New OleDb.OleDbCommand LOAD objConexion = conectar() Así busco Try objcomando.Connection = objConexion objcomando.CommandText = "select * from tblcliente where idcliente ='" & Val(texId.Text) & "'" Dim dt As New DataTable Dim da As New OleDb.OleDbDataAdapter(objcomando) da.Fill(dt) If dt.Rows.Count = 0 Then |
| ||||
Respuesta: Access fin
Código vb:
Ver original |
Etiquetas: |