Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeAccess

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Access.AccessDocument System.IO.FileInfo

Creates a native Access database without a provider, seed file or execution.

Syntax

New-OfficeAccess
[-Force]
[[-Path] <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Live
New-OfficeAccess
[-AllowLoss]
[-Content] <ScriptBlock>
[-Force]
[-PassThru]
[-Path] <String>
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Content

Description

A path associates a live model without writing it; a content block atomically saves and closes it. The .mdb or .accdb extension selects the native file family.

Examples

Create a contacts table.

New-OfficeAccess -Path ./Contacts.accdb {
    AccessTable Contacts { AccessColumn ContactId -Type AutoNumber; AccessColumn DisplayName -MaxLength 100 }
}

Parameters

-Force SwitchParameter optional
Permit replacement of the associated destination.
-Path String required in Contentposition: 0
Optional live association; required for a completed content block.
-Title String optional
Database title.
-WhatIf SwitchParameter optional
Shows what would happen if the command runs.
-Confirm SwitchParameter optional
Prompts for confirmation before running the command.
-AllowLoss SwitchParameter optionalsets: Content
Accept reductions reported by native save.
-Content ScriptBlock requiredposition: 1sets: Content
Authoring block completed before atomic publication.
-PassThru SwitchParameter optionalsets: Content
Return the saved FileInfo after the block completes.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.