Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yuri Rubinov
  Where is Yuri Rubinov?
 Pennsylvania - United States
 Yuri Rubinov
 To: Maurizio Zazzi
  Where is Maurizio Zazzi?
 Maurizio Zazzi
Subject: RE: Updating Access table via remote view with ...
Thread ID: 15873 Message ID: 15916 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, October 03, 2002 6:54:41 PM         

Can not answer to your question directly. But here is the approach where you could control all properties and processes via code:

'Driver={Microsoft Access Driver (*.mdb)}');
TO gnConnHandle
* all other string details go here if neccessary

IF gnConnHandle <= 0
= MESSAGEBOX('Cannot make connection', 16)

*Check and set connection properties if needed using sqlgetprop/sqlsetprop

sele (table)
lcsql= "Update access _TABLE_NAME set COLUMN_NAME = "+(VALUE_go here)+" WHERE ....."
release aa
lnerr=sqlexec(gnConnHandle, lcsql)
if ln<=0 and aerror(aa)>0 &&get the error description if any
?RECN(), aa[3]


> I have to update (fill a blank field in all rows) an Access 2000 table with values stored in a dbf table. I have successfully made a connection to tha Access table and created a remote view to that table. I want to replace the blank field in the Access table with the values stored in the VFP table with a small program which is a simple scan... replace... endscan like this:
> open mydatabase
> use mydbftable order field1 in 0
> use myviewtoaccess in 0
> select myviewtoaccess 
> scan
> select mydbftable
> seek myviewtoaccess.field1
> replace myviewtoaccess.field2 with mydbftable.field2 in myviewtoaccess 
> select myviewtoaccess 
> endscan

> The code runs but only the first row in the Access table is updated. Then the program stops at endscan with the message 'Connection myconnection is busy'. Before thsi final message I receive this couple of warnings:
> Warning: the query timeout cannot be set
> Warning: the connection async/sync mode cannot be set
> The update criteria in myviewtoaccess are as follows:
> Send SQL updates: selected
> SQL UPDATE: selected
> The connection settings are as follows (all default except for warnings):
> Asynchronous execution: not selected
> Display warnings: selected
> Batch processing: selected
> Automatic transactions: selected
> Packet size: 4096
> Connection: 15
> Idle: 0
> Query: 0
> Wait time: 100
> What am I missing?
> Thanks
> Maurizio Zazzi


Updating Access table via remote view with a scan Posted by Maurizio Zazzi @ 10/2/2002 6:30:15 PM
Just to add... Posted by Maurizio Zazzi @ 10/3/2002 3:29:12 PM
RE: Updating Access table via remote view with ... Posted by Yuri Rubinov @ 10/3/2002 6:54:41 PM