Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax of SQLEXEC
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Syntax of SQLEXEC
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
00960758
Message ID:
00960758
Vues:
46
Hi all,
 lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
    "Dbq=" + B +;
    "Uid=username;" +;
    "Pwd=password;"


  *--> connect to Access database ( Establishes a connection to a data source.  )
  lnAccess = SQLSTRINGCONNECT(lcConnectionStr)

*-- lnAccess return a good result.

SELECT LEFT(T.cnomteleph, 5) + PADR(TRANSFORM( T.iid ) , 5 ) AS 'Code' , ;
    T.cnomteleph,;
    R.cnom_conj AS 'Nom2',;
    PADR( ALLTR( Ru.Cnomrue ) + IIF( !EMPTY( T.Cnum ),  ','   , ' '  ) + T.Cnum , 40 ) AS 'Rue',;
    P.cpays,;
    P.ccp ,;
    P.clocalite,;
    'Res' AS 'codePersonnel';
    FROM  amline!Teleph AS 'T' INNER JOIN amline!Resident AS 'R' ON  T.iid = R.itelephoneid ;
    INNER JOIN amline!Rue  AS 'Ru' ON  Ru.iid = T.irueid  ;
    INNER JOIN amline!Poste AS 'P' ON  P.iid = Ru.iposteid ;
    WHERE R.lputinpopsy = .T. INTO Cursor BobClient


  csql = "INSERT INTO IFCOMPAN ( CID, CNAME1, CNAME2, CADDRESS1, CZIPCODE, CLOCALITY, CVATCAT, "+;
    " CCUSTYPE, CSUPTYPE, CCUSCAT, CCUSPAYDELAY )"+;
    " SELECT B.code, B.nomteleph , B.nom2 , b.rue, b.cpays + b.ccp , b.localite , 'N' ,   'C' , 'U' ,"
    
    csql2 = csql + " B.codePersonnel , 30 FROM BobClient AS 'B'  "

    
  nresult = SQLEXEC( lnAccess ,   csql2 )  
nresult return -1 because he do'nt see BobClient.

How can i do to have a good result ?

bernhart
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform