how to validate if an .IMD
Forums
hello, how to validate if an .IMD file is found in the working project directory to send a message to the user who must first verify that this file exists and then proceed with the execution of the tests.
Cheers,
Cheers,
I execute the program and I place a table that exists and another that does not exist and it always throws me false, what will be happening? Here is the code.
Sub Main
MsgBox checkIfIMDFileExists("This file doesn't exist.IMD")
End Sub
Function checkIfIMdFileExists(sFilename As String) As Boolean
Dim db As database
On Error Resume Next
client.OpenDatabase("MOVI.CONTABLES.IMD")
'client.OpenDatabase(sFilename)
If err.number <> 0 Then
checkIfIMdFileExists = False
err.number = 0
Else
checkIfIMdFileExists = True
End If
End Function
There are different ways you
There are different ways you can do this, these example tries to open the file and then checks for an error. If the file doesn't exist then IDEA throws an error which we capture and know that the file doesn't exit.