Skip to main content
OCLC Support

CreateLocalFile

Find the syntax, use, parameters, return values, and an example for the CreateLocalFile macro command in Connexion client.
Syntax nResult = CS.CreateLocalFile (sPath)
Use to Create a local file in the specified path and set the file as the default.

If the file already exists, set the specified existing file as the default.
Parameters For sPath, enter the full path and file name.
Comments The macro command does not validate the path name for a file, nor does it create directories in the path.

The specified file extension determines the type of file created:
  • *.bib.db creates a local bibliographic save file
  • *.auth.db creates a local authority save file
  • *.bibcd.db creates a local bibliographic constant data file
  • *.authcd.db creates a local authority constant data file
Return values Returns an integer with one of the following values:
  • 0 = New file successfully created and set as the default
  • 1 = Existing file successfully set as the default
  • 2 = Access to the specified file denied
  • 3 = Specified file not found
  • 4 = Undefined error
Example Sub Main()

     Dim CS As Object
     Set CS = GetObject(“Connex.Client”)

     Dim nResult as Integer
     nResult = CS.CreateLocalFile “D:\Program Files\MyLocalFiles\ Jan10.bib.db”

     If nResult = 0 Then
          MsgBox “File was created and set as the default successfully”
     Else If nResult = 1 Then
     MsgBox “Local file already exists. Set as default”

     Else
          MsgBox “Error creating local file”
     End If
End Sub

What this example does
  • Attempts to create a new local bibliographic save file named Jan10.bib.db in the file path D:\Program Files\MyLocalFiles.
  • If the new file is successfully created and set as the default, returns the message: File was created and set as the default successfully.
    Or
    If the file already exists, sets the file as default and returns the message: Local file already exists. Set as default.
    Or
    If the file is not created or does not exist or another type of error occurs, returns the message: Error creating local file.