Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move data into a SQL-Server database?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00540114
Message ID:
00540216
Vues:
15
>4) Insert a new record in the SQL-Server database/table... directly from the C program.
You can do in C, but unless you have strong reasons to do it in C, Why don't you do it in VFP?

Here is the pseudo-code to do it in VFP.
<b>
* Connect to SQL Server.
nConn = SQLConnect( "your connection string goes here" )
</b>

open ascii source file

DO WHILE NOT FEOF()
   m.lcLine = FGet()
   IF NOT EMPTY(m.lcLine)
      Parse m.lcLine into components (i.e. array la_RawData)
<b>
      * Insert record in SQL Server via SQL-pass through.
      SQLExec( nConn, "INSERT INTO sqltable( fields...) values( ... )" )
</b>
    ENDIF
ENDDO
Hector Correa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform