Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating an older Access file (mdf) from VFP
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01674938
Message ID:
01674939
Views:
65
>Hi,
>
>I am trying to update an older Access file from VFP.
>I am able to open the mdf file, and read the table I wish to update into a cursor.
>I update the contents of the cursor, but ab unable to write back the changes to the source table.
>
>Code:
>
>nAccessHandle = sqlstringconnect( "DRIVER=Microsoft Access Driver (*.mdb, *.accdb); DBQ=C:\Ndb5.mdb;" )
>
>if nAccessHandle < 1
>   messagebox( "Invalid connection to access database" )
>   return
>endif 
>
>nSQLAns = SQLExec( nAccessHandle, "select number, name, phone, name1 from directory", "tbcurs" )
>
>if nSQLAns < 1
>   messagebox( "Unable to get any data..." )
>   sqldisconnect( nAccessHandle )
>   return
>endif
>
>
>select tbcurs
>use c:\TB order gcode in 0 alias TB
>set relation to left(number,6) into tb
>replace name1 with tb.unit for !eof('tb')
>
>=tableupdate(1,.t.,) && does not work!!
>
Can you just send direct update command back (e.g. not try to use tableupdate, but rather send generate update command in VFP and send it back to Access same way you get the data)?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform