el código correspondiente es el siguiente:
Private Sub Form_Load()
On Error GoTo aviso
If cn.State = 1 Then cn.Close
conectarse
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "select * from usuarios"
'rs.Open "select * from usuarios", cn, adOpenKeyset, adLockOptimistic
Set rs = cmd.Execute
rs.Close
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockReadOnly
rs.Open
'Set rs = cmd.Execute
Set DataGrid1.DataSource = rs
total = rs.RecordCount
Label1.Caption = "Total " & total & " Usuarios "
Call formato
Exit Sub
Enviado por : Luis Ramirez
1 comentario:
donde esta tu funcion conectarse?
Publicar un comentario