Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connect to remove database
Message
De
03/01/2011 19:09:25
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01494335
Message ID:
01494511
Vues:
51
>I could access database and browse my table using commands below.
>
>No I would like to do a simple task as "replace all OK with .T." in my table.
>
>Please help me.
>
>
>
>lcServer="siteground150.com"
>lcPort= 3306
>lcDatabase= "monitorr_acrisoft"
>lcUser= "monitorr_monitor"
>lcPassword= myPassword
>lcStringConn="Driver={MySQL ODBC 5.1 Driver};Server=&lcServer;Port=lcPort;Option=16384;Stmt=;Database=&lcDatabase;Uid=&lcUser;Pwd=&lcPassword"
>SQLSETPROP(0,"DispLogin",1)
>lnHandle=SQLSTRINGCONNECT(lcStringConn)
>upit="select * from reembolso"
>IF lnHandle > 0
>  rez=SQLEXEC(lnHandle, upit, "ctable1")
>    BROWSE
>
And what's the alias of the cursor you're browsing? It should be ctable1.
>SELECT reembolso         &&  fails here
Of course it fails, that table is on the remote server. You, actually, never opened that table. Your remote server did, and it sent you a recordset from that table.
>    replace nome WITH 'test'   &&  fails here
You probably didn't stay on the ctable1 alias, or ctable1 didn't have a nome field, but it shouldn't have failed - it may still work if you remove the previous SELECT reembolso line.

It would work, but it wouldn't do what you want. It would replace the field in the cTable1 cursor, which is your local copy of the remote table. It does not save automatically at all - if you close this cursor, it's all gone, and you haven't sent the changes back to your table on the server.

IOW, you need to do what MarcG just said, and, well, someone has to say this: you need to learn how things are done differently when you do them to a server, as opposed to your local tables. Start by reading http://fox.wikis.com/wc.dll?Wiki~SQLPass-Through

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform