te adjunto esto, derrepente te sirva, saludos
******************** Creando Ambiente **************************
ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
PUBLIC vMac, vIP, vIcon
public lcPath, lcJustDir, lRes
PUBLIC gi_windowId as Long
PUBLIC gs_app_name as String
PUBLIC dbLink
PUBLIC gDBMS, gDsn, gServidor, gPuerto, gBaseDatos, gUsuarioSQL, gPass, gRuta
set echo off
set talk off
set safety off
set confirm on
set deleted on
SET EXACT ON
SET date BRITISH
SET CENTURY ON
SET NULLDISPLAY TO ''
SET ESCAPE OFF
IF FILE("C:\Windows\SysWOW64\odbcad32.exe") THEN
gs_so = '64'
ELSE
gs_so = '32'
ENDIF
*ON KEY LABEL CTRL+M _screen.resize()
vDate=CTOD("30/03/2012") && Fecha de Expiracion de programa
IF f_fecha_server() >= vDate
=MESSAGEBOX("Licencia de Uso a Expirado "+ chr(13)+ "Comuniquese con el Programador"+ chr(13)+ "Tel: 25-1042 Cel: 97-9487458",16,"Cesly Soft")
ELSE
*IF vMac="00-14-2A-9C-F5-FD" THEN &&Mac Adress de PC a Instalar Programa
gi_windowId = 0
Ruta_Sis = substr(sys(16),1,at("\",sys(16),2))
set defa to &Ruta_Sis
set path to PRG, form, Data, report, images, Menu, clases, icon, lmcal, OutlookNavBar, Vcx, Temp, util
***verifica el servidor y BD mediante un archivo cfg (ini)
IF NOT FILE('app_conf.ini')
MESSAGEBOX("Faltan archivos de configuración nesesarios para ejecutar la aplicación", 16, gs_app_name)
Return
ELSE
DO getini.prg
ENDIF
*!* IF DRIVETYPE(SYS(5))<>3&&verificamos si se esta ejecutando dentro de un disco duro local
*!* MESSAGEBOX("No se puede iniciar el programa en unidades" + CHR(13)+;
*!* "diferentes a discos duros locales",;
*!* 16,"SGT 2008 Edición Profesional")
*!* RETURN
*!*
*!* ENDIF
DO defines.prg
DO dbpgsql.prg
DO search.prg
DO search_w.prg
DO search_c.prg
DO transaction_w.prg
DO search_m.prg
DO funciones_p.prg
DO search_p.prg
DO funciones_m.prg
DO busqueda.prg
vIcon="globe.ico"
_SCREEN.VISIBLE=.F.
SET PROCEDURE TO getini ADDITIVE
SET PROCEDURE TO defines ADDITIVE
SET PROCEDURE TO dbpgsql ADDITIVE
SET PROCEDURE TO search ADDITIVE
SET PROCEDURE TO search_w ADDITIVE
SET PROCEDURE TO search_c ADDITIVE
SET PROCEDURE TO defines_menu ADDITIVE
SET PROCEDURE TO defines_menu_w ADDITIVE
SET PROCEDURE TO search_m ADDITIVE
SET PROCEDURE TO transaction_w ADDITIVE
SET PROCEDURE TO funciones_p ADDITIVE
SET PROCEDURE TO search_p.prg ADDITIVE
SET PROCEDURE TO funciones_m.prg ADDITIVE
SET PROCEDURE TO busqueda.prg ADDITIVE
vMac=MACAddress()
vIP=IPAddress()
IF ConectDB() THEN
gs_empresa = f_get_data_select("select TRIM(razon_social) as dato from empresa")
DO FORM frm_acceso.scx
If _vfp.StartMode > 0 && Run time
CLEAR
Read Events
ENDIF
RELEASE ALL
ELSE
DisconectDB()
CLEAR EVENTS
RELEASE ALL
&&CLOSE ALL
&&QUIT
ENDIF
ENDIF
--
Moises Daniel Vilchez Tello
Chiclayo - Lambayeque - Peru