AddAttribute (string name, string value) - IOdbcAttribute Adds or updates an
ODBC driver attribute. Returns the created or updated IOdbcAttribute.
RemoveAttribute (string name) Removes an ODBC driver attribute by its
name.
Properties
Attributes (SAFEARRAY(Variant)) {get} Returns an array of
IOdbcAttribute objects for this driver.
DllFile (IFile) {get}{set} Gets or sets the driver DLL file as an
IFile (must be added to the project files).
Name (string) {get}{set} Gets or sets the display name of the ODBC driver.
SetupFile (IFile) {get}{set} Gets or sets the driver setup DLL file as an
IFile (optional; used by some drivers).
Sample commands
# IAdvinstProject automation
$advinst = New-Object -ComObject "AdvancedInstaller"
$project = $advinst.CreateProject($advinst.ProjectTypes.Enterprise)
# Intermediate steps
# Create a folder under the Application Folder (APPDIR) for ODBC resources
$project.PredefinedFolders.ApplicationFolder.CreateFolder("ODBC resources") | Out-Null
# Add files to APPDIR\ODBC resources\printer_driver from a local directory
$project.FilesComponent.AddFolderContentS("APPDIR\ODBC resources\printer_driver", "F:\cmdlet\res\ODBC resources\printer_driver")
# Get a specific DLL (as IFile) to use for Driver/Translator DllFile/SetupFile
$driverDll = $project.FilesComponent.Files | ? { $_.Name -eq "AnyDeskPrintDriverRenderFilter.dll" }
# Add a new ODBC Driver and set attributes
$driver = $project.ODBC.NewDriver("My ODBC Driver", $driverDll)
$driver.AddAttribute("MaxBufferSize", "2048") | Out-Null
$driver.AddAttribute("DriverODBCVer", "03.80") | Out-Null
# Optionally set a setup DLL (another IFile)
# $setupDll = $project.FilesComponent.Files | ? { $_.Name -eq "DriverSetup.dll" }
# $driver.SetupFile = $setupDll
# List driver attributes
$driver.Attributes
# Remove a specific attribute by name
$driver.RemoveAttribute("MaxBufferSize")
# (Optional) Delete the driver via the ODBC component
# $project.ODBC.DeleteOdbc($driver)
Notes
IFile requirement:DllFile and SetupFile must reference files already added
to the project (e.g., via FilesComponent).
Indexing:Drivers returns an array; access items with
$project.ODBC.Drivers[0].