ÿÿ  CHHVBScriptEngine       ÿþÿ( A l l g e m e i n )    ÿþÿ( D e k l a r a t i o n e n ) ÿþÿ' ( D e k l a r a t i o n e n )  
 ÿþÿÿ_/' R e m a r k :   D i g i t a l   D a t a   -   D a t e n b a n k   E i n g r i f f   z u r   Ü b e r m i t t l u n g   v o n   B e l e g m e t a d a t e n   a n   e i n   e x t e r n e s   S y s t e m .  
 ' V B   S c r i p t   D o c u m e n t  
 '  
 ' D i g i t a l   D a t a  
 ' L u d w i g - R i n n - S t r a ß e   1 6  
 ' 3 5 4 5 2   H e u c h e l h e i m  
 ' T e l . :   0 6 4 1   /   2 0 2 3 6 0  
 ' E - M a i l :   i n f o - f l o w ( a t ) d i g i t a l d a t a . w o r k s  
 '  
 ' V e r s i o n   N u m b e r :   1 . 1 . 0 . 0  
 ' V e r s i o n   D a t e :   2 5 . 0 9 . 2 0 2 0  
  
 O n   E r r o r   R e s u m e   N e x t  
  
 ' # # # # # # # # # #   g e t   p a r a m e t e r   # # # # # # # # #  
  
 	 ' N e c e s s a r y   t o   g e t   p a r a m e t e r s   i n   t h e   c o d e .   D o   n o t   c h a n g e !  
 	 p a r a m s   =   M P a r a m e t e r s  
  
 	 ' P a r a m e t e r   1   t o   1 9   a r e   r e s e r v e d   b y   W i n L i n e   i n t e r a l   f u n c t i o n  
  
 	 ' F i r s t   c a l l   p a r a m e t e r   =   c o n t r o l   d e b u g   m o d e  
 	 p a r a m D e b u g M o d e 	 	 	 	 	 =   p a r a m s ( 2 0 )  
  
 	 ' S e c o n d   c a l l   p a r a m e t e r   =   u n i q u e   k e y  
 	 p a r a m D o c A c c o u n t A n d R u n n i n g N r 	 	 =   p a r a m s ( 2 1 )  
  
 	 ' T h i r d   c a l l   p a r a m e t e r   =   ( 1 =   A n f r a g e / A n g e b o t ;   2 =   A u f t r a g / B e s t e l l u n g ;   3 =   L i e f e r s c h e i n ;   4 = R e c h n u n g )  
 	 p a r a m D o c T y p e 	 	 	 	 	 =   p a r a m s ( 2 2 )  
  
 	 ' F o u r t h   c a l l   p a r a m e t e r   =   d e b i t o r   d o c   =   1   /   c r e d i t o r   d o c   =   2  
 	 p a r a m P o s t i n g T y p e 	 	 	 	 =   p a r a m s ( 2 3 )  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # # #   s e t   c o n s t a n t s   # # # # # # # # #  
  
 	 ' G e t   c u r r e n t   M a n d a n t o r N r ,   l i k e   " 5 0 0 M " .  
 	 W i n L i n e C u r r e n t M a n d a t o r N r   =   C W L S t a r t . C u r r e n t C o m p a n y . N r  
  
 	 ' G e t   c u r r e n t   m e s o   y e a r ,   l i k e   1 4 4 0   ( ( 2 0 2 0   -   1 9 0 0 )   *   1 2   =   1 4 4 0 ) .  
 	 W i n L i n e C u r r e n t Y e a r   =   C W L S t a r t . C u r r e n t C o m p a n y . C o m p a n y Y e a r  
  
 	 ' G e t   c u r r e n t   u s e r n a m e   l i k e   " m e s o " .  
 	 W i n L i n e C u r r e n t U s e r   =   C W L S t a r t . C u r r e n t U s e r . A c c o u n t  
  
 	 ' G e t   c u r r e n t   W i n L i n e   e x e   p a t h  
 	 W i n L i n e A p p P a t h   =   C W L S t a r t . A p p l i c a t i o n . A p p P a t h  
  
 	 ' G e t   c u r r e n t   d a t e   a n d   t i m e .  
 	 T i m e s t a m p   =   N o w  
  
 	 ' B a s i c   S Q L   w h e r e   f o r   m a n d a t o r   a n d   c u r r u e n t   m e s o y e a r  
 	 S Q L Q u e r y _ B a s i c W h e r e     =   "   a n d   ( m e s o c o m p   =   ' "   &   W i n L i n e C u r r e n t M a n d a t o r N r   & " ' )   a n d   ( m e s o y e a r   =   "   &   W i n L i n e C u r r e n t Y e a r   &   " ) "  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # # #   s e t   v a r i a b l e s   # # # # # # # # #  
  
 	 ' D e b u g   ( D e b u g   M e l d u n g e n   a n z e i g e n )  
 	 D E B U G _ O N   =   f a l s e  
 	 D E B U G _ M E S S A G E   =   " "  
 	 D e b u g M o d e       =   p a r a m D e b u g M o d e  
  
 	 ' S e t   p a t h   f o r   D i g i t a l   D a t a   M o d u l e s .   D e f a u l t :   M a n d a t o r   a d d i t i o n a l   f i e l d   1 0   ( I F - M o d u l P f a d - D i g i t a l D a t a )   =   C W L S t a r t . C u r r e n t C o m p a n y . V a l u e ( 2 0 9 )  
 	 M o d u l e D e f a u l t S o u r c e P a t h   =   C W L S t a r t . C u r r e n t C o m p a n y . V a l u e ( 2 0 9 )  
  
 	 ' S Q L   D B   f o r   M e t a d a t a   E x p o r t  
 	 S Q L D a t a b a s e _ E X I M   =   " [ E X I M _ M E D S ] "  
  
 	 ' S Q L   T B   i n   D B   f o r   M e t a d a t a   E x p o r t  
 	 S Q L T a b l e _ E X I M   =   " [ d b o ] . [ E X _ W E B S H O P _ B E L E G E ] "  
 	  
 	 ' S e t   S Q L   T a b l e   a n d   Q u e r y   f o r   D o c H e a d .   D e f a u l t :   " T 0 2 5 "  
 	 S Q L T a b l e _ D o c H e a d   =   " [ T 0 2 5 ] "  
 	 S Q L Q u e r y _ D o c H e a d   =   " c 0 0 0   =   ' "   &   p a r a m D o c A c c o u n t A n d R u n n i n g N r   &   " ' "   &   S Q L Q u e r y _ B a s i c W h e r e 	  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # # #   f u n c t i o n s   a n d   s u b s   # # # # # # # # #  
  
 ' F u n c t i o n   t o   l o a d   V B S   m o d u l e s    
 P u b l i c   F u n c t i o n   L o a d V B S M o d u l e ( V B S M o d u l e P a r a m s )  
  
 	 ' S Y N O P S I S  
 	 	 ' F u n c t i o n   w i l l   l o a d   e x t e r n a l   -   a d d i t i o n a l   -   V B S   M o d u l e s   i n t o   c u r r e n t   S c r i p t .  
  
 	 ' D E S C R I P T I O N  
 	 	 ' B y   w o r k i n g   W i t h   M o d u l e s ,   t h i s   F u n c t i o n   I s   n e c e s s a r y   T o   l o a d   e x t e r n a l   M o d u l   F u n c t i o n s   i n t o   t h e   c u r r e n t   V B - S c r i p t .  
 	 	 ' C a l l   p a r a m e t e r   m u s t   b e   a n   a r r a y ,   b e c a u s e   V B - S c r i p t   f u n c t i o n s   c a n n o t   h a n d l e   o p t i o n a l   P a r a m e t e r s .  
 	 	 ' I n   d e v e l e p m e n t   a n d   T e s t   E n v i r o m e n t   i t   i s   p o s s i b l e ,   t o   w o r k   w i t h   d i s t r i b u t e d   F o l d e r s   w i t h   d i f f e r e n t   M o d u l e s .   T h e r e f o r   t h e   P a r a m e t e r  
 	 	 ' " V B S M o d u l e P a r a m s ( 1 ) "   ( w h i c h   i s   t h e   M o d u l e O v e r r i d e S o u r c e P a t h )   a n d   t h e   p r e s e t   V a r i a b l e   " M o d u l e D e f a u l t S o u r c e P a t h "   a r e   m a d e   f o r .  
                 ' A f t e r   a   s u c c e s s f u l   I m p o r t   o f   a   M o d u l e ,   F u n c t i o n   w i l l   R e t u r n   T r u e ,   o t h e r w i s e   a   F a l s e .  
  
 	 ' R E Q U I R E M E N T   G e n e r a l  
 	 	 ' V B S   m u s t   b e   e n a b l e d  
  
 	 ' R E Q U I R E M E N T   A s s e m b l y  
 	 	 ' < N O N E >  
  
 	 ' R E Q U I R E M E N T   V a r i a b l e s  
 	 	 ' F S O M o d u l e ,   M o d u l e ,   M o d u l e N a m e ,   M o d u l e C o d e ,   M o d u l e P a t h ,   W s h S h e l l ,   M o d u l e A u t o S o u r c e P a t h  
  
 	 ' R E Q U I R E M E N T   V a r i a b l e s   p r e S e t  
 	 	 ' M o d u l e D e f a u l t S o u r c e P a t h   ( o p t i o n a l )  
  
 	 ' R E Q U I R E M E N T   F u n c t i o n s  
 	 	 ' < N O N E >  
  
 	 ' V E R S I O N  
 	 	 ' N u m b e r :   1 . 3 . 0 . 1   /   D a t e :   2 9 . 0 8 . 2 0 2 0  
  
 	 ' P A R A M E T E R   V B S M o d u l e P a r a m s ( 0 )   =   M o d u l e N a m e  
 	 	 ' G i v e   t h e   M o d u l e   N a m e ,   y o u   w a n t   t o   l o a d   i n t o   t h e   c u r r e n t   V B - S c r i p t .  
  
 	 ' P A R A M E T E R   V B S M o d u l e P a r a m s ( 1 )   =   M o d u l e O v e r r i d e S o u r c e P a t h  
 	 	 ' O p t i o n a l   P a r a m e t e r .   B y   g i v i n g   t h e   M o d u l e O v e r r i d e S o u r c e P a t h ,   F u n c t i o n   w i l l   n o t   c h e c k   o t h e r   P a t h s   f o r   t h e   F u n c t i o n   y o u   w a n t   t o   l o a d . 	 	  
  
 	 ' E X A M P L E  
 	 	 ' D i m   V B S M o d u l e P a r a m s  
 	 	 ' R e d i m   V B S M o d u l e P a r a m s ( 0 )  
 	 	 ' V B S M o d u l e P a r a m s ( 0 )   =   M o d u l e  
 	 	 ' L o a d V B S M o d u l e ( V B S M o d u l e P a r a m s )  
  
 	 ' E X A M P L E  
 	 	 ' D i m   V B S M o d u l e P a r a m s  
 	 	 ' R e d i m   V B S M o d u l e P a r a m s ( 1 )  
 	 	 ' V B S M o d u l e P a r a m s ( 0 )   =   M o d u l e  
 	 	 ' V B S M o d u l e P a r a m s ( 1 )   =   " D : \ S c r i p t F i l e s \ M o d u l e s " 	 	  
 	 	 ' L o a d V B S M o d u l e ( V B S M o d u l e P a r a m s )  
  
 	 O n   E r r o r   R e s u m e   N e x t  
  
 	 ' C l e a r   E r r o r   V a r i a b l e  
 	 E r r . C l e a r  
  
     	 D i m   F S O M o d u l e ,   M o d u l e ,   M o d u l e N a m e ,   M o d u l e C o d e ,   M o d u l e P a t h ,   W s h S h e l l ,   M o d u l e A u t o S o u r c e P a t h  
 	 S e t   F S O M o d u l e   =   C r e a t e O b j e c t ( " S c r i p t i n g . F i l e S y s t e m O b j e c t " ) 	  
  
 	 ' H o w   m a n y   p a r a m e t e r s   a r e   g i v e n   i n   t h e   a r r a y  
 	 I f   ( U B o u n d ( V B S M o d u l e P a r a m s )   =   0 )   T h e n  
  
 	 	 M o d u l e N a m e   =   V B S M o d u l e P a r a m s ( 0 )  
  
 	 	 I f   F S O M o d u l e . F o l d e r E x i s t s ( M o d u l e D e f a u l t S o u r c e P a t h )   T h e n  
 	 	  
 	 	 	 ' I f   g l o b a l   v a r   i s   s e t ,   t a k e   i t !  
 	 	 	 M o d u l e P a t h   =   M o d u l e D e f a u l t S o u r c e P a t h  
 	 	  
 	 	 E L S E  
  
 	 	 	 ' G e t t i n g   t h e   c u r r e n t   d i r ,   w h e n   M o d u l e D e f a u l t S o u r c e P a t h   d o e s   n o t   e x i s t  
 	 	 	 S e t   W s h S h e l l   =   C r e a t e O b j e c t ( " W S c r i p t . S h e l l " )  
 	 	 	 M o d u l e A u t o S o u r c e P a t h   =   W s h S h e l l . C u r r e n t D i r e c t o r y  
  
 	 	 	 ' B y   t h i s   p a r a m e t e r   w a y   t h e   p a t h   i s   m o r e   v a r i a b l e  
 	 	 	 M o d u l e P a t h   =   M o d u l e A u t o S o u r c e P a t h   &   " \ "   &   " M o d u l e s "  
  
 	 	 	 I f   ( D E B U G _ O N   =   T r u e )   O r   ( D e b u g M o d e   =   " E n a b l e d " )   T h e n  
 	 	 	 	 M S G B O X 	 " P a r a m e t e r 1   =   "   &   V B S M o d u l e P a r a m s ( 0 )   &   v b C r l f   &   _  
 	 	 	 	 	 	 " M o d u l e D e f a u l t S o u r c e P a t h   =   "   &   M o d u l e D e f a u l t S o u r c e P a t h , , " D E B U G   I n f o :   P a r a m e t e r   V a l u e s   i n   A r r a y   -   V B S M o d u l e P a r a m s "  
 	 	 	 E n d   I f  
 	 	  
 	 	 E n d   i f  
  
 	 E l s e I f   ( U B o u n d ( V B S M o d u l e P a r a m s )   =   1 )   T h e n  
  
 	 	 M o d u l e N a m e   =   V B S M o d u l e P a r a m s ( 0 )  
 	 	 M o d u l e P a t h   =   V B S M o d u l e P a r a m s ( 1 )  
  
 	 	 I f   ( D E B U G _ O N   =   T r u e )   O r   ( D e b u g M o d e   =   " E n a b l e d " )   T h e n  
 	 	 	 M S G B O X 	 " P a r a m e t e r 1   =   "   &   V B S M o d u l e P a r a m s ( 0 )   &   v b C r l f   &   _  
 	 	 	 	 	 " P a r a m e t e r 2   =   "   &   V B S M o d u l e P a r a m s ( 1 ) , , " D E B U G   I n f o :   P a r a m e t e r   V a l u e s   i n   A r r a y   -   V B S M o d u l e P a r a m s "  
 	 	 E n d   I f  
 	  
 	 E l s e  
  
 	 	 m s g b o x 	 " I n v a l i d   f u n c t i o n   c a l l ! "   	 	 &   v b C r l f   &   _  
 	 	 	 	 " P l e a s e   c h e c k   t h e   p a r a m e t e r s ! " 	 &   v b C r l f   &   _    
 	 	 	 	 " . . . t h e n   r e s t a r t   t h i s   S c r i p t ! " , v b E x c l a m a t i o n   , " L o a d V B S M o d u l e :   P a r a m e t e r   E r r o r ! "  
  
 	 E n d   i f  
  
 	 ' C h e c k i n g   f o l d e r   p a t h s 	 ' C h e c k   i f   g i v e n   p a t h   i s   v a l i d ,   i f   n o t   c r e a t e   i t  
 	 I f   N o t   F S O M o d u l e . F o l d e r E x i s t s ( M o d u l e P a t h )   T h e n  
  
 	 	 F S O M o d u l e . C r e a t e F o l d e r ( M o d u l e P a t h )  
 	 	 m s g b o x 	 " T h e   M o d u l e P a t h   d o e s n t   e x i s t ,   t r y i n g   t o   c r e a t e ! "   &   v b C r l f   &   _  
 	 	 	 	 " P l e a s e   p l a c e   y o u r   M o d u l e s   t h e r e :   "   &   v b C r l f   &   _    
 	 	 	 	 M o d u l e P a t h   &   v b C r l f   &   v b C r l f   &   _  
 	 	 	 	 " . . . t h e n   r e s t a r t   t h i s   S c r i p t ! " , v b E x c l a m a t i o n   , " L o a d V B S M o d u l e :   M o d u l e s   /   M o d u l e P a t h   i s   m i s s i n g ! "  
 	 E l s e  
  
 	 	 ' C l e a r   E r r o r   V a r i a b l e  
 	 	 E r r . C l e a r  
  
 	 	 ' B u i l d i n g   f u l l   m o d u l e   p a t h   a n d   n a m e  
 	 	 M o d u l e F u l l N a m e   =   M o d u l e P a t h   &   " \ "   &   M o d u l e n a m e   &   " . v b s "  
  
 	 	 ' d o e s   t h e   f i l e   e x i s t ?  
 	 	 I f   N o t   F S O M o d u l e . F i l e E x i s t s ( M o d u l e F u l l N a m e )   T h e n  
 	 	 	 I f   E r r . N u m b e r   < >   0   T h e n  
 	 	 	 	 M S G B O X   	 " E r r o r   C o d e :   " &   E r r . N u m b e r   &   v b C r l f   &   _  
 	 	 	 	 	 	 " E r r o r   D e s c r i p t i o n :   " &   E r r . D e s c r i p t i o n , , " E R R O R :   M o d u l e   d o e s   n o t   e x i s t !   "  
 	 	 	 	 E r r . C l e a r  
 	 	 	 	 L o a d V B S M o d u l e   =   " F a l s e "  
 	 	 	 E n d   I f  
  
 	 	 E l s e  
  
 	 	 	 ' O p e n   f i l e  
 	 	 	 S e t   M o d u l e   =   F S O M o d u l e . O p e n T e x t F i l e ( M o d u l e F u l l N a m e ,   1 )  
  
 	 	 	 ' G e t   f i l e   c o n t e n t  
 	 	 	 M o d u l e C o d e   =   M o d u l e . R e a d A l l  
  
 	 	 	 ' C l o s e   f i l e   h a n d l e  
 	 	 	 M o d u l e . C l o s e  
  
 	 	 	 ' E x e c u t e   t h e   f i l e   c o n t e n t  
 	 	 	 E x e c u t e G l o b a l   M o d u l e C o d e  
  
 	 	 	 I f   E r r . N u m b e r   < >   0   T h e n  
 	 	 	 	 M S G B O X   	 " E r r o r   C o d e :   " &   E r r . N u m b e r   &   v b C r l f   &   _  
 	 	 	 	 	 	 " E r r o r   D e s c r i p t i o n :   " &   E r r . D e s c r i p t i o n , , " E R R O R :   M o d u l e   c a n n o t   b e   l o a d e d ! "  
 	 	 	 	 E r r . C l e a r  
 	 	 	 	 L o a d V B S M o d u l e   =   " F a l s e "  
 	 	 	 E l s e  
 	 	 	 	 L o a d V B S M o d u l e   =   " T r u e "  
 	 	 	 E n d   I f  
  
 	 	 E n d   I f  
  
 	 E n d   I f  
  
 E n d   F u n c t i o n   ' L o a d V B S M o d u l e  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # #   p r e p a r i n g   p a r t   # # # # # # # # #  
  
 ' R e s e t   E r r o r   V a r  
 E r r . C l e a r  
  
 ' D i s p l a y   d e b u g   i n f o s ,   i f   e n a b l e d  
 I f   ( D E B U G _ O N   =   T r u e )   O r   ( D e b u g M o d e   =   " E n a b l e d " )   T h e n  
 	 A d d D e b u g L i n e 	 " C u r r e n t U s e r :   "   &   C u r r e n t U s e r  
 	 A d d D e b u g L i n e 	 " M a n d a t o r N r :     "   &   M a n d a t o r N r  
 	 A d d D e b u g L i n e 	 " C u r r e n t Y e a r :   "   &   C u r r e n t Y e a r  
 	 A d d D e b u g L i n e 	 " T i m e s t a m p :       "   &   T i m e s t a m p  
  
 	 S h o w D e b u g B o x   " R u n t i m e   V a r i a b l e s "  
  
 	 C R L F   =   c h r ( 1 3 ) & c h r ( 1 0 )    
 	 m s g   =   " P a r a m e t e r : "   &   C R L F    
 	    
 	 F o r   i   =   1   T o   U b o u n d ( p a r a m s )    
 	 	 m s g   =   m s g   &   i   &   " . :   "   &   p a r a m s ( i )   &   C R L F    
 	 N e x t    
  
 	 m s g b o x   m s g   , ,   " M a c r o   N a m e :   "   &   C W L M a c r o . M N a m e  
 E n d   I f  
  
 ' P r e p a r e   A r r a y   ( A r r a y s   a r e   z e r o   b a s e d ! )  
 M o d u l e s   =   A r r a y ( " A d d D e b u g L i n e " , " S h o w D e b u g B o x " , " G e t W i n L i n e D o c I n f o B y A c c o u n t A n d R u n n i n g N r " , " S w i t c h W i n L i n e G o T o M a c r o s " )  
  
 D i m   M o d u l e  
  
 ' L o a d   e x t e r n a l   M o d u l e s .  
 F o r   E a c h   M o d u l e   I n   M o d u l e s  
  
 	 ' C r e a t e   t h e   a r r a y   t o   p a s s   i n   t o   o u r   f u n c t i o n  
 	 D i m   V B S M o d u l e P a r a m s  
  
 	 ' C a l l   t h e   s u b r o u t i n e   w i t h   t w o   a r g u m e n t s  
 	 R e d i m   V B S M o d u l e P a r a m s ( 0 )   ' C h a n g e   t o   1 ,   f o r   2   v a l u e s  
 	 V B S M o d u l e P a r a m s ( 0 )   =   M o d u l e  
 	 ' V B S M o d u l e P a r a m s ( 1 )   =   " "  
  
         L o a d V B S M o d u l e R e s u l t   =   L o a d V B S M o d u l e ( V B S M o d u l e P a r a m s )  
  
         I f   ( L o a d V B S M o d u l e R e s u l t   < >   " T r u e " )   T h e n  
  
 	 	 ' S e t   W S c r i p t   =   C r e a t e O b j e c t ( " W S c r i p t . S h e l l " )  
                 M S G B O X   " M o d u l e :   "   &   M o d u l e   &   "   w a s   N o t   s u c c e s f u l   b e e n   l o a d e d ! "   &   v b C r l f   &   _  
 	 	 	       " P l e a s e   l o a d   t h e   M o d u l e   a n d   t r y   a g a i n ,   r u n n i n g   t h i s   F u n c t i o n / M o d u l e ! "   &   v b C r l f   &   _  
 	 	 	       " E x i t i n g ,   b e c a u s e   o f   t h i s   I s s u e . "   &   v b C r l f   &   _  
                 	       E r r . D e s c r i p t i o n ,   v b C r i t i c a l ,   " D E B U G   I n f o :   C a n n o t   l o a d   M o d u l e ! "  
                 ' W S c r i p t . Q u i t   =   n o t   p o s s i b l e   i n   W i n l i n e   e n v i r o m e n t  
  
         E n d   I f  
  
 N e x t   ' e n d   f o r   e a c h  
  
  
 ' G e t   S Q L   r o w   f o r   t h e   d o c  
 S e t   S Q L R e s u l t _ D o c H e a d   =   C W L S t a r t . C u r r e n t C o m p a n y . S e a r c h R e c o r d   ( S Q L T a b l e _ D o c H e a d ,   S Q L Q u e r y _ D o c H e a d )  
  
 I f   E r r . N u m b e r   < >   0   T h e n  
 	 M S G B O X   	 " E r r o r   C o d e :   " &   E r r . N u m b e r   &   v b C r l f   &   _  
 	 	 	 " E r r o r   D e s c r i p t i o n :   " &   E r r . D e s c r i p t i o n , , " E R R O R :   G e t t i n g   D o c H e a d   f r o m   D B   T a b l e   " &   S Q L T a b l e _ D o c H e a d  
 	 E r r . C l e a r  
 E l s e  
  
 	 ' I f   n o   l i n e   r e s u l t s  
 	 I f   S Q L R e s u l t _ D o c H e a d . R o w C o u n t   =   - 1   T h e n  
  
 	 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 	 M S G B O X   " N o   R o w s   f o u n d ,   S Q L :   " &   S Q L Q u e r y _ D o c H e a d , , " D E B U G   -   I n f o :   D o c H e a d   f r o m   D a t a b a s e   t a b l e   " &   S Q L T a b l e _ D o c H e a d  
 	 	 E n d   I f  
  
 	 E l s e i f   S Q L R e s u l t _ D o c H e a d . R o w C o u n t   =   1   T h e n  
  
 	 	 D o c H e a d   =   S Q L R e s u l t _ D o c H e a d  
  
 	 	 ' g e t   a l l   n e e d e d   v a l u e s   f r o m   T 0 2 5   p l u s   a d d i t i o n a l   v a l u e s    
 	 	 D o c H e a d   =   G e t W i n L i n e D o c I n f o B y A c c o u n t A n d R u n n i n g N r ( p a r a m D o c A c c o u n t A n d R u n n i n g N r ,   p a r a m P o s t i n g T y p e ,   p a r a m D o c T y p e )  
  
 	 	 D o c C r e a t e d W h e n 	 	 =   D o c H e a d ( 5 9 )  
 	 	 D o c L a s t C h a n g e W h e n 	 =   D o c H e a d ( 6 0 )  
 	 	 D o c H e a d T e x t 1 	 	 =   D o c H e a d ( 6 3 )  
 	 	 D o c H e a d T e x t 2 	 	 =   D o c H e a d ( 6 4 )  
 	 	 D o c H e a d T e x t 3 	 	 =   D o c H e a d ( 6 5 )  
 	 	 D o c H e a d T e x t 4 	 	 =   D o c H e a d ( 6 6 )  
 	 	 D o c H e a d T e x t 5 	 	 =   D o c H e a d ( 6 7 )  
 	 	 D o c H e a d T e x t 6 	 	 =   D o c H e a d ( 6 8 )  
 	 	 D o c H e a d T e x t 7 	 	 =   D o c H e a d ( 6 9 )  
 	 	 D o c H e a d T e x t 8 	 	 =   D o c H e a d ( 7 0 )  
 	 	 D o c H e a d T e x t 9 	 	 =   D o c H e a d ( 7 1 )  
 	 	 D o c H e a d T e x t 1 0 	 	 =   D o c H e a d ( 7 2 )  
  
 	 	 D o c C o m m e n t 	 	 	 =   D o c H e a d ( 1 6 5 )  
  
 	 	 D o c T y p e   	 	 	 =   D o c H e a d ( 2 0 0 )  
 	 	 D o c N r   	 	 	 	 =   D o c H e a d ( 2 0 1 )  
  
 	 E l s e  
  
 	 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 	 M S G B O X   " T o   m a n y   R o w s   f o u n d ,   S Q L :   " &   S Q L Q u e r y _ D o c H e a d , , " D E B U G   -   I n f o :   D o c H e a d   f r o m   D a t a b a s e   t a b l e   " &   S Q L T a b l e _ D o c H e a d  
 	 	 E n d   I f 	  
  
 	 E n d   I f  
  
 E n d   I f  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # # # #   m a i n   p a r t   # # # # # # # # # # # #  
  
 I f   ( D o c H e a d   < >   " " )   A n d   ( D o c T y p e   < >   " " )   T h e n  
  
 	 S e t   C o n n   =   C W L S t a r t . C u r r e n t C o m p a n y . C o n n e c t i o n  
  
 	 S Q L I n s e r t   =   " "  
 	 S Q L I n s e r t   =   S Q L I n s e r t   &   " I N S E R T   I N T O   "   &   S Q L D a t a b a s e _ E X I M   &   " . "   &   S Q L T a b l e _ E X I M   &   "   "  
 	 S Q L I n s e r t   =   S Q L I n s e r t   &   " ( [ M A N D A N T ] ,   [ W I R T S C H A F T S J A H R ] ,   [ B E L E G _ A R T ] ,   [ B E L E G _ N R ] ,   [ B E L E G _ K O N T O _ U N D _ L A U F N U M M E R ] ,   [ B E L E G _ K O M M E N T A R ] ,   [ B E L E G _ E R S T E L L T _ W A N N ] ,   [ B E L E G _ G E A E N D E R T _ W A N N ] ,   [ B E L E G _ K O P F T E X T 1 ] ,   [ B E L E G _ K O P F T E X T 2 ] ,   [ B E L E G _ K O P F T E X T 3 ] ,   [ B E L E G _ K O P F T E X T 4 ] ,   [ B E L E G _ K O P F T E X T 5 ] ,   [ B E L E G _ K O P F T E X T 6 ] ,   [ B E L E G _ K O P F T E X T 7 ] ,   [ B E L E G _ K O P F T E X T 8 ] ,   [ B E L E G _ K O P F T E X T 9 ] ,   [ B E L E G _ K O P F T E X T 1 0 ] ) "  
 	 S Q L I n s e r t   =   S Q L I n s e r t   &   " V A L U E S ( ' " &   W i n L i n e C u r r e n t M a n d a t o r N r   & " ' ,   ' " &   W i n L i n e C u r r e n t Y e a r   & " ' ,   ' " &   D o c T y p e   & " ' ,   ' " &   D o c N r   & " ' ,   ' " &   p a r a m D o c A c c o u n t A n d R u n n i n g N r   & " ' ,   ' " &   D o c C o m m e n t   &   " ' ,   ' " &   D o c C r e a t e d W h e n   & " ' ,   ' " &   D o c L a s t C h a n g e W h e n   & " ' ,   ' " &   D o c H e a d T e x t 1   & " ' ,   ' " &   D o c H e a d T e x t 2   & " ' ,   ' " &   D o c H e a d T e x t 3   & " ' ,   ' " &   D o c H e a d T e x t 4   & " ' ,   ' " &   D o c H e a d T e x t 5   & " ' ,   ' " &   D o c H e a d T e x t 6   & " ' ,   ' " &   D o c H e a d T e x t 7   & " ' ,   ' " &   D o c H e a d T e x t 8   & " ' ,   ' " &   D o c H e a d T e x t 9   & " ' ,   ' " &   D o c H e a d T e x t 1 0   &   " ' ) "  
  
 	 I f   ( D E B U G _ O N   =   T r u e )   O r   ( D e b u g M o d e   =   " E n a b l e d " )   T h e n  
  
 	 	 m s g b o x   S Q L I n s e r t  
  
 	 E n d   I f  
  
 	 ' e x e c u t e   t h e   i n s e r t   c o m m a n d  
 	 S Q L R e s u l t   =   C o n n . E x e c u t e S Q L ( S Q L I n s e r t )  
  
 	 I f   ( S Q L R e s u l t   =   " f a l s c h " )   O r   ( S Q L R e s u l t   =   " f a l s e " )   T h e n  
  
 	 	 M S G B O X     " A c h t u n g :   F e h l e r   b e i m   E x p o r t   d e r   D o k u m e n t   M e t a d a t e n ! "   &   v b C r l f   &   _  
 	 	 	 	 " B i t t e   i n f o m i e r e n   S i e   I h r e n   A d m i n ,   ü b e r   E x p o r t   P r o b l e m e   m i t / b e i   d i e s e m   B e l e g ! " , v b O k o n l y + v b C r i t i c a l , " A b g e b r o c h e n e   M e t a d a t e n   Ü b e r g a b e ! "  
  
 	 E n d   I f  
  
 E n d   I f  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ' # # # # # # # # # # #   f i n a l   p a r t   # # # # # # # # # # #  
  
 ' i f   D e b u g M o d e   e n a b l e d   o r   D e b u g O n   i s   t r u e ,   g o   t o   t h e   M a c r o   W i n d o w  
 S w i t c h W i n L i n e G o T o M a c r o s  
  
 ' # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  
  
 ÿþÿ' E n d e   v o n   ( D e k l a r a t i o n e n )  
  
 