Framework EDI Reference. Methods and Properties
ediDocument. LoadSchema

Specifies a schema or Standard Reference Library version to load.

Syntax:

Parameters:

Returns

If successful the object of type FREDI.ediSchema is returned; otherwise an empty object is returned if the operation fails.

Remarks

Muliple schemas can be specified and made available as implementation guidelines to a document, so this method can be called multiple times for each schema to use.

Unlike the ImportSchema method, the LoadSchema method does not immediately import the schema information when this method is invoked, but rather it is imported when the EDI document begins to get processed (when LoadEdi is called).

Example 1.  To load a Standard Exchange Format (SEF) file.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.LoadSchema(“C:\FILES\850.SEF”, Schema_Standard_Exchange_Format)

Example 2. To load a version from the Standard Reference Library. In this example, the version is ASC/X12 version 4030.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.LoadSchema(“X|004030”, Schema_Standard_Reference_Library)

Example 3. To load multiple schemas.

Dim oEdiDoc As Fredi.ediDocument
Dim oSchema As Fredi.ediSchema
:
Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False
:
Set oSchema = oEdiDoc.LoadSchema("850_4010.SEF", Schema_Standard_Exchange_Format)
Set oSchema = oEdiDoc.LoadSchema("997_4010.SEF", Schema_Standard_Exchange_Format)

oEdiDoc.LoadEdi sPath & sEdiFile