Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to move data into a SQL-Server database?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00540114
Message ID:
00540216
Views:
23
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform