Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Access Tables from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01150648
Message ID:
01150654
Views:
24
>All,
>
>This is not something I have tried to do before and even after reviewing code samples and articles, I must be extremely thick since it's not sinking in.
>
>There is a remote MS Access database with multiple tables. Variable names and types are "well mannered" with respect to VFP naming conventions and data types. What I want to do is be able to insert new records or replace values in existing records from a cursor of VFP table into the appropriate Access tables.
>
>Let's say that I have A_Data.mdb with tables - Table1 and Table2. Table1 has two text fields Var01 and Var02 of C(50).
>
>Could someone please post a citation or the code to setup the connection and then insert/replace records into Table1 from a VFP table, VFPTable1 ?
>
>Thanks,
>Stephen
TEXT TO Myconnstring TEXTMERGE NOSHOW PRETEXT 7
    DRIVER=Microsoft Access Driver (*.mdb);
    UID=admin;
    UserCommitSync=Yes;
    Threads=3;
    SafeTransactions=0;
    PageTimeout=5;
    MaxScanRows=8;
    MaxBufferSize=2048;
    FIL=MS Access;
    DriverId=25;
    DefaultDir=F:\TEST_VFP;
    DBQ=F:\TEST_VFP\a_data.mdb
ENDTEXT

sqlHandler = SQLSTRINGCONNECT(Myconnstring)
IF sqlhandler < 1
   MESSAGEBOX("No connection!")
   AERROR(err_array)
***   ...
   RETURN
ENDIF

TEXT TO sqlcommand TEXTMERGE NOSHOW
    INSERT INTO Table1 VALUES('first','second')
ENDTEXT

test_exec = SQLEXEC(sqlHandler , sqlcommand)
IF test_exec < 1
   MESSAGEBOX("Error!")
   AERROR(err_array)
***   ...
   RETURN
ENDIF
SQLDISCONNECT(sqlHandler)
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform