Problems update tables using VB 
Author Message
 Problems update tables using VB

I am a new VB and Foxpro user.  I can open, read and change Access database
tables. But i am having problems adding/editing Foxpro tables. I can
open/read but no edits/adds.

Does anyone have any code that works for VB 5.0 and Foxpro 5.0?

Any specifics on Foxpro registry entries that could make a table read only
overriding the VB paramaters which set it to read/write?
---------
my code....

    Dim wrkJetVend As Workspace
    Dim SBTFoxVendor As Database
    Dim SBTvendorRS As Recordset

    Set wrkJetVend = DBEngine.Workspaces(0)
    Set SBTFoxVendor = wrkJetVend.OpenDatabase _
        ("C:\AP\", True, False, "FoxPro 3.0;")

    Set SBTvendorRS = SBTFoxVendor.OpenRecordset("APMAST", dbOpenTable)
    SBTvendorRS.AddNew

        (error occurs on the .Addnew - "3027 - database object is read
only")

(I have tried many options for the parameters in the OpenDatabase and
OpenRecordset functions - get different errors but all seem related to the
table not being updatable.)
---------

Any suggestions appreciated.
Gina Helms
Intercoastal Technologies,



Sat, 20 May 2000 03:00:00 GMT  
 Problems update tables using VB

First of all VB5's DAO does not support VFP 5.0 dbc's it only goes upto
VFP3.0.
However, RDO utilizes ODBC connectivity and works fine.
DIM DSN as String
DSN=";DSN=" + "Visual FoxPro DataBase" +
";UID=;PWD=;SourceDB=""C:\AP\MYDBC.DBC"
Dim Cn1 As New rdoConnection
With Cn1
    .Connect = "DSN=" + CStr(DSN)
    .LoginTimeout = 50
    .CursorDriver = rdUseOdbc
    .EstablishConnection rdDriverNoPrompt, False
End With
Dim n As Long
n = 0
DIM SQL as String
SQL = "Select * from table where condition"

Dim Rs1 As rdoResultset
Set Rs1 = Cn1.OpenResultset(SQL, rdOpenFowardOnly, rdConcurValues)

If Rs1.EOF = False Then
... insert your code here

end if

Rs1.Update          'Saves the open data tables

Rs1.Close
Cn1.Close



Quote:
> I am a new VB and Foxpro user.  I can open, read and change Access
database
> tables. But i am having problems adding/editing Foxpro tables. I can
> open/read but no edits/adds.

> Does anyone have any code that works for VB 5.0 and Foxpro 5.0?

> Any specifics on Foxpro registry entries that could make a table read
only
> overriding the VB paramaters which set it to read/write?
> ---------
> my code....

>     Dim wrkJetVend As Workspace
>     Dim SBTFoxVendor As Database
>     Dim SBTvendorRS As Recordset

>     Set wrkJetVend = DBEngine.Workspaces(0)
>     Set SBTFoxVendor = wrkJetVend.OpenDatabase _
>         ("C:\AP\", True, False, "FoxPro 3.0;")

>     Set SBTvendorRS = SBTFoxVendor.OpenRecordset("APMAST", dbOpenTable)
>     SBTvendorRS.AddNew

>         (error occurs on the .Addnew - "3027 - database object is read
> only")

> (I have tried many options for the parameters in the OpenDatabase and
> OpenRecordset functions - get different errors but all seem related to
the
> table not being updatable.)
> ---------

> Any suggestions appreciated.
> Gina Helms
> Intercoastal Technologies,




Sun, 21 May 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

2. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

3. Problem deleting and updating Fox table from Excel using DAO

4. Problem updating tables using a view

5. problem updating an Oracle table using VFP remote views

6. How to update Master table from second table using FPD2.6a

7. Need help with updating a table using another table

8. Update/insert into a table using another table?

9. DSNLess connection to Visual FoxPro table from Access 2000 using VB

10. Updating an SQL table using FoxPro program through a view

11. Using a trigger to update fields in the same table

12. UPDATE using value from another table

 

 
Powered by phpBB® Forum Software