Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax of SQLEXEC
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Syntax of SQLEXEC
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00960758
Message ID:
00960758
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform