Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create mysqltable from .dbf
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Create mysqltable from .dbf
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01580247
Message ID:
01580247
Vues:
54
HI

I used the program below to convert. dbf to mysql

http://www.tek-tips.com/faqs.cfm?fid=4878

It is supposed transforming dbf to slq table.

After executed, it resulted: create table ACESSO_layout (NOME C(50),TEXTO M))

But this command line results error when applyed directly on phpMyadmin.

The problem is because SQL diferente from mysql, or why it does not work ?

*****************************************************************************

layout_to_code(GETFILE('*.dbf'))

PROCEDURE layout_to_code
LPARAMETERS lcTable

IF ADIR(laTemp,lcTable)=0
MESSAGEBOX("No Table Selected")
RETURN
ENDIF



lcTable=JUSTSTEM(lcTable)


IF USED(lcTable) = .f.
USE (lcTable) IN 0
ENDIF

SELECT (lcTable)

lcCmd=""
FOR lnFieldCnt = 1 TO AFIELDS(laTemp)
lcCmd=lcCmd+laTemp(lnFieldCnt,1)+" "+laTemp(lnFieldCnt,2)+;
IIF(laTemp(lnFieldCnt,2)="D","","("+TRANSFORM(laTemp(lnFieldCnt,3))+;
IIF(laTemp(lnFieldCnt,2)='N',","+TRANSFORM(laTemp(lnFieldCnt,4))+")",")"))+;
IIF(MOD(lnFieldCnt,4)=0,",;"+CHR(13),",")
ENDFOR

lcCmd=LEFT(lcCmd,LEN(lcCmd)-4)+")"

STRTOFILE("create table "+lcTable+"_layout ("+lcCmd+")",lcTable+'_layout_prg.prg')
COMPILE (lcTable+"_layout_prg")

MESSAGEBOX("'"+lcTable+"_layout_prg' sucessfully created")

MODIFY COMMAND (lcTable+"_layout_prg") NOWAIT
ENDPROC

*********************************************************************************************************************
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform