DatabaseRecordCountAsDouble
Gets the number of records of the database ImportedFileName at the time the database was imported.
The record count is not defined by IDEA in a consistent manner. The record count can be defined as Int32, Int64 or double. For IDEAScript it is a double. The name of the property reflects this.
Compatibility
Available as of IDEA version 9.1.1
Syntax
DatabaseRecordCountAsDouble()
Remark
This property is read-only.
Type
Double
Example
Option Explicit
'Importfiles, ISimpleImportFiles, ISimpleImportFile
'Gets a reference to the collection of file descriptors of the current CIR or extension.
Sub Main()
'Importfiles
Dim importfiles As Variant
Set importfiles = SmartContext.ImportFiles
Dim txt As String
txt = "Files: "
Dim onefile As Object 'onefile available properties: onefile.Alias, .ImportedFileName, .DatabaseId
For Each onefile In importfiles
Dim filealias As String
filealias = onefile.Alias
txt = txt & " Alias: " & filealias & Chr(13) & Chr(10)
Dim AliasHasMatch As Boolean
AliasHasMatch = onefile.AliasHasMatch
If AliasHasMatch Then
txt = txt & "The table alias was successfully resolved." & Chr(13) & Chr(10)
Else
txt = txt & "The table alias was not successfully resolved." & Chr(13) & Chr(10)
End If
Dim databaseHasBadData As Boolean
databaseHasBadData = onefile.databaseHasBadData
If databaseHasBadData Then
txt = txt & "The associated IDEA database has bad data." & Chr(13) & Chr(10)
Else
txt = txt & "The associated IDEA database has not bad data." & Chr(13) & Chr(10)
End If
Dim databaseIdAsString As String
databaseIdAsString = onefile.databaseIdAsString
txt = txt & " DatabaseIdAsString: " & databaseIdAsString & Chr(13) & Chr(10)
' DatabaseId not available in iss file
Dim databaseRecordCountAsDouble As Double
databaseRecordCountAsDouble = onefile.databaseRecordCountAsDouble
txt = txt & " DatabaseRecordCountAsDouble: " & Str(databaseRecordCountAsDouble) & Chr(13) & Chr(10)
'DatabaseRecordCount not available in iss file
Dim importedFilename As String
importedFilename = onefile.importedFilename
txt = txt & " ImportedFileName: " & importedFilename & Chr(13) & Chr(10)
Dim isSelected As Boolean
isSelected = onefile.isSelected
' This property make sense to be used in premacro, before the import of the files
' for example if one of the optional table was not selected to be imported the user can be announced and he can decide if he want to continue the import or not
If isSelected Then
txt = txt & "The table was selected to be imported" & Chr(13) & Chr(10)
Else
txt = txt & "The table was not selected to be imported" & Chr(13) & Chr(10)
End If
Next
MsgBox txt
'ISimpleImportFiles
'Determines whether the collection contains an element with the specified alias: "DataBaseAlias"
If importfiles.Contains("Alias") Then
MsgBox"The table with alias ""Alias"" is among the files which could be imported"
Else
MsgBox"The table with alias ""Alias"" is not among the files which could be imported"
End If
'Gets the number of elements in the collection.
Dim numberofelements As Long
numberofelements = importfiles.Count
MsgBox"The number of the files which could be imported is: " & Str(numberofelements)
'GetEnumerator - not used in iss file only in c#
'Gets the object with the specified alias or the specified zero-based index.
Dim lastfile As Object
Set lastfile = importfiles.Item(numberofelements - 1)
MsgBox"LastFile:" & lastfile.importedFilename
End Sub