Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import from Excel
Message
De
15/07/2004 16:07:49
 
 
À
13/07/2004 02:44:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00918198
Message ID:
00924894
Vues:
25
Ok - here it is
oform=creat('my_form')
oform.show

DEFINE CLASS my_form AS FORM
	import_file_name=''
    caption=[Mohammed's form]
    
	ADD object mybutton1 as mybutton
	
	
    
	PROCEDURE import_file
	LOCAL jline
	THISFORM.import_file_name=GETFILE('XLS','TEST')
    
    
    IF !FILE(thisform.import_file_name)
       =MESSAGEBOX('The file does not exist...',16,'System Message')
       return(.f.)
    ENDIF

    IF FILE(JUSTSTEM((thisform.import_file_name))+ '.dbf')
       jmess=MESSAGEBOX('Warning, the file already exists...'+ CHR(13)+ CHR(13)+ 'Overwrite?',36,'Question')
       IF jmess=6  && ok
       else
         return(.f.)
       endif
    ENDIF

    
    IF .not. '.XLS' $ UPPER(thisform.import_file_name)
       =MESSAGEBOX('The file is not an excel file...',16,'System Message')
       return(.f.)
    ENDIF
    
    
*-- test for file etc...
*-- if everything fine there

	jline='import from '+ THISFORM.import_file_name+ ' type xl5'
	&jline

    BROWSE
    

	ENDPROC
ENDDEFINE


DEFINE class mybutton as commandbutton
	Caption="Import File"
	Default=.T.
	top=1
	left=1
	PROCEDURE click
	dodefault()
	thisform.import_file()

ENDDEFINE 
>hello,
>
>thank you,
>
>but still i need full example if you can.
>
>i read your code but i dont know were i can use it.and how.
>
>thanks.
Thanks,

Stacy



Black Mountain Software, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform