Results 1 to 8 of 8

Thread: VB6 & dBase IV files - How to show deleted records?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4

    Question

    I have rewritten some apps from Paradox
    to VB6 but one problem I have is, I have
    not yet found a way to show deleted records
    on dBase IV tables in VB. Does anyone know
    if this is possible?

    Thanks for any help in advance.

  2. #2
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    I don't know about Dbase but in FoxPro (which is Xbase) you can do something like this.
    Code:
    cnnYourConnect.Execute "Set Deleted Off"
    This allows me to see the deleted records.

    if you want to set it back.
    Code:
    cnnYourConnect.execute "Set Deleted On"

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    I receive an error : Expected SQL Statement.

    Am I not doing it right?

  4. #4
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    How are connecting to your database? (code?)

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    Public Sub first()
    Set cnConn = New ADODB.Connection
    Set cmdConn = New ADODB.Command
    Set rsConn = New ADODB.Recordset
    cnConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\users\mdoss\pdcdata\data;Extended Properties=dBase IV;Persist Security Info=False"
    Set cmdConn.ActiveConnection = cnConn
    cmdConn.CommandText = "filectrl.dbf"
    cmdConn.Execute "Set Deleted Off"
    Set rsConn = cmdConn.Execute(adCmdTable)
    rsConn.MoveFirst
    While Not rsConn.EOF
    x = x + 1
    rsConn.MoveNext
    Wend
    MsgBox Str(x)
    End Sub

    I changed the execute to run on the command,
    I do not receive any error messages, but it
    still does not show deleted records.

  6. #6
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    I don't know how to see the deleted records using the Dbase driver, but if want you could use the Visual FoxPro Driver and build your connect string like so:
    Code:
        strConnect = "DSN=Visual FoxPro Tables;UID=;"
        strConnect = strConnect & "PWD=;SourceDB=f:\users\mdoss\pdcdata\data;"
        strConnect = strConnect & "SourceType=DBF;Exclusive=No;"
        strConnect = strConnect & "BackgroundFetch=Yes;"
        strConnect = strConnect & "Collate=Machine;Null=Yes;Deleted=No;"
    
        cnConn.Open strConnect
    Hope this helps.

    [Edited by dcarlson on 12-07-2000 at 11:49 AM]

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    Still failing.
    Cannot find installable ISAM.

  8. #8
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    You may need to install the VFP Driver. Check your ODBC datasources for the Microsoft Visual FoxPro Driver. I think you can install it with the Visual Basic or Visual Studio CD.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width