Using Data from a Foxpro 3.0 DBC linked databases 
Author Message
 Using Data from a Foxpro 3.0 DBC linked databases

I am rewriting an existing bad Foxpro program in VB, and it is nearly
complete.  I want to give the user the option to load client data from the
foxpro database as needed, many clients will never be used.  So I have a
command button that lets them search for the client in the old database,
but something isn't quite right when I open it as stated below.

I have included the fragment that I think is the problem,  the OpenDataBase
and get a error 3219 and I have included the definition on the error.  I
have played around with the DBreadonly and the locking enough so I don't
think it is the problem, but whatever help you can give me would be
appreciated.

Dim FoxDataDB As Database, strsql As String
Dim OldRecords As Recordset, temClientNumber As String
"I have tried all combinations of true false

Set FoxDataDB = OpenDatabase( _
                       "C:\newtrans\trans.dbc", _
                       False, True, "FoxPro dbc;")
  strsql = "Select * from Clients where  Clientno = '" & temClientNumber &
"' ;"
 Set OldRecords = FoxDataDB.OpenRecordset(strsql, dbOpenSnapshot,
dbReadOnly)
  If OldRecords.EOF = True And OldRecords.BOF = True Then
    MsgBox "This client number not found in the FoxPro Database"
    Exit Sub
  End If
  ClearClientData
  OldRecords.MoveFirst
  With OldRecords
    MedNumber.Text = !MediCaid
    LName.Text = !Last_Name
    FName.Text = !first_Name
    If !Sex = 0 Then
      Male.Value = True
      Female.Value = False
    Else
      Female.Value = True
      Male.Value = False
    End If
    Minit.Text = !midd_Init
    Street(0).Text = !St_Number & " " & !Street
   End With

End Sub

Possible causes:

     You tried to write to a read-only property. See the Help topic for the
property to determine whether it is read/write.
     You tried to use a method or property on a type of Recordset object that
the method or property doesn't apply to. See the Recordset object Summary
topic to determine which methods and properties apply to a given type of
Recordset object.

     You tried to append a property to a Properties collection of an object
that doesn't support user-defined properties.
     You tried to use the Update method on a read-only Recordset object.



Tue, 25 Apr 2000 03:00:00 GMT  
 Using Data from a Foxpro 3.0 DBC linked databases

Unless someone knows something that I would love to know, it doesn't seem
possible to pass Sql to an OpenRecordSet, either when it is not a Jet
database or is a FoxPro don't know which yet.  Able to open and use the
Database as long as I am willing to take it total, I can live with that,
but does slow things down.



Fri, 28 Apr 2000 03:00:00 GMT  
 Using Data from a Foxpro 3.0 DBC linked databases

Quote:

> Unless someone knows something that I would love to know, it doesn't seem
> possible to pass Sql to an OpenRecordSet, either when it is not a Jet
> database or is a FoxPro don't know which yet.  Able to open and use the
> Database as long as I am willing to take it total, I can live with that,
> but does slow things down.

I haven't bothered to check if it works on others, but SQL CAN be used on a
dynaset!  Unfortunately, M/S has complicated things in that attached
databases can NOT be opened as tables, and searched like them.  Various modes
give different results on the SAME table!  JET should handle all of that in
the background!  BTW, a dynaset is perhaps the most flexible(though NOT the
best).  You can do the SQL operations on an attached table.  I would HOPE you
can do them on ANY attached table!  FOXPRO historically has NOT been SQL, but
one would hope it can be through JET!

I have only been working with JET, ODBC, and some SQL systems.  It's been a
while since I touched DBASE(foxpros father), CLIPPER(it's cousin), or any
thing related.

Steve



Fri, 28 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to access a foxpro 3.0 dbf which is linked to a dbc

2. FoxPro 3.0 .DBC Problems....

3. ADO Data Grid and Visual Foxpro 6 DBC

4. ADO Data Grid and Visual Foxpro 6 DBC

5. ADO Data Grid and Visual Foxpro 6 DBC

6. Accessing a Visual Foxpro 3.0 Database using VB4 pro

7. Accessing a Visual Foxpro 3.0 Database using VB4 pro

8. Linking Access 97 to Visual Foxpro 3.0 via ODBC

9. Using FoxPro 3.0 tables in VB using ADO

10. problem accessing foxpro dbc

11. FoxPro DBC ISAM

12. Open Foxpro dbc/dbf with ADO

 

 
Powered by phpBB® Forum Software