Application.DeleteFromDatabase Method
Project Developer Reference |
Deletes a project stored in a database.
Syntax
expression.DeleteFromDatabase(Name, UserID, DatabasePassWord, FormatID)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Name | Optional | String | The name of the source file or data source to open, and the name of the project to delete from the database. |
UserID | Optional | String | A user ID to use when accessing the database. |
DatabasePassWord | Optional | String | A password to use when accessing the database. |
FormatID | Optional | String | The file or database format. If Project recognizes the format of the file specified with Name, FormatID is ignored. Can be one of the following format strings:
Format StringDescription
"MSProject.mpd"Project database
"MSProject.odbc"ODBC database
"MSProject.mdb"Microsoft Access database
|
Format String | Description | ||
"MSProject.mpd" | Project database | ||
"MSProject.odbc" | ODBC database | ||
"MSProject.mdb" | Microsoft Access database |
Return Value
Boolean
Remarks
The Name argument must contain a file name string, or an ODBC data source name (DSN), and the project name string. The syntax for a data source is <DataSourceName>\Projectname. The less than (<) and greater than (>) symbols must be included, and a backslash ( \ ) must separate the data source name from the project name. The DataSourceName itself can either be one of the ODBC data source names installed on the computer, a file DSN, or a path and file name for a file-based database.
In the following examples, [My Documents] is the full path of your My Documents folder, and [Program Files] is the full path of your Program Files folder:
"<Corporate SQL Database>\Factory Construction"
"<*[My Documents]\*PROJECT1.MDB>\System Roll-out Plan"
"<[Program Files]\Common Files\ODBC\Data Sources\Projects Database.dsn>\Project X"
Example
The following example deletes projects from a Project database, as specified by the user.
Visual Basic for Applications |
---|
|
See Also