How can I delete the file associated with this id? The path is not correct. Do I need to put the objRs!n_pdfname into a variable first?
VB Code:
Call CreateConnection(objConn) Set objRs = New ADODB.Recordset objRs.ActiveConnection = objConn objRs.CursorLocation = adUseClient objRs.CursorType = adOpenDynamic objRs.LockType = adLockOptimistic objRs.Source = "select * from Documents where n_id='" & MSFlexGrid1.Text & "'" objRs.Open Dim Msg Msg = "Do you really want to delete this Document?" 'If user clicks the No button, stop QueryUnload. If MsgBox(Msg, vbQuestion + vbYesNo, Me.Caption) = vbYes Then objConn.Execute ("Delete from Documents where n_id = '" & objRs!n_id & "'") MsgBox (objRs!n_pdfname) MsgBox ("App.Path & "\" & "Documents" & "\" & '" & objRs!n_pdfname & "'") 'Kill "App.Path & "\" & "Documents" & "\" & '" & objRs!n_pdfname & "'") End If objRs.Close Call CloseConnection(objConn)




Reply With Quote