Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sample code for SQL Pass Through
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00157627
Message ID:
00157653
Vues:
13
>I'll give you a simple one here:
>
>
>* Create connection to back end
>lnSQLHandle = SQLCONNECT("myDSN","myUser","myPassword")
>
>* Check for good connection
>IF lnSQLHandle > 0
>  * Send insert to back end
>  lnResult = SQLEXEC(lnSQLHandle, "Insert Mytable Values('a','b','c')")
>
>  * Check for successful insert
>  IF lnResult <> -1
>    WAIT WINDOW "Success!"
>  ELSE
>    * Show query error
>    =AERROR(myErr)
>    WAIT WINDOW myErr(1,2)
>  ENDIF
>
>  * Diconnect from back end
>  =SQLDISCONNECT(lnSQLHandle)
>ELSE
>  * Show connection error
>  =AERROR(myErr)
>  WAIT WINDOW myErr(1,2)
>ENDIF
>
>
>HTH
>
>>Is there any examples of a complete sequence for using sql pass through to insert new records into a table existing on an MS/sql server? I can't seem to find any full documentation.
>>
>>What I want to do is insert records into a database on a ms/sql server using SPT. Thanks in advance!
>>
>>Gary

I can't believe it was that simple :) Thanks, I really do appreciate the help!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform