Results 1 to 2 of 2

Thread: Btrieve and VB

  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Unanswered: Btrieve and VB

    Below is come VB code that fails when attempting to open a Btrieve file. Note that there are no available DDFs so the files must be opened with the Btrieve API. Please help me determine why the code is failing. The status message indicates that the folder is invalid and when I have modified the code to include the folder name along with the file name the status message indicates that it is an invalid file name. The folder and file names are correct.

    Code:
    Declare Function BTRCALL Lib "wbtrv32.dll" (ByVal intOperationCode As Integer, ByVal strPositionBlock As String, varDataBuffer As Any, intDataLength As Integer, varKeyBuffer As Any, ByVal intKeyLength As Integer, ByVal intKeyNumber As Integer) As Integer
    
    Dim intBtrOperationCode As Integer
    Dim strBtrPositionBlock As String * 128
    Dim strBtrDataBuffer As String
    Dim intBtrDataLength As Integer
    Dim strBtrKeyBuffer As String
    Dim intBtrKeyLength As Integer
    Dim intBtrKeyNumber As Integer
    Dim intBtrStatus As Integer
    intBtrOperationCode = 17
    strBtrPositionBlock = Space(128)
    strBtrDataBuffer = ""
    intBtrDataLength = 0
    strBtrKeyBuffer = "C:\BTRTEST"
    intBtrKeyLength = Len(strBtrKeyBuffer)
    intBtrKeyNumber = 0
    intBtrStatus = BTRCALL(intBtrOperationCode, strBtrPositionBlock, strBtrDataBuffer, intBtrDataLength, strBtrKeyBuffer, intBtrKeyLength, intBtrKeyNumber)
    DoEvents
    intBtrOperationCode = 0
    strBtrKeyBuffer = "TEST.BTR"
    intBtrKeyLength = Len(strBtrKeyBuffer)
    intBtrStatus = BTRCALL(intBtrOperationCode, strBtrPositionBlock, strBtrDataBuffer, intBtrDataLength, strBtrKeyBuffer, intBtrKeyLength, intBtrKeyNumber)
    DoEvents
    intBtrOperationCode = 1
    intBtrStatus = BTRCALL(intBtrOperationCode, strBtrPositionBlock, strBtrDataBuffer, intBtrDataLength, strBtrKeyBuffer, intBtrKeyLength, intBtrKeyNumber)
    DoEvents
    Last edited by loquin; 03-22-07 at 14:50.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    I've never tried accessing a Btrieve database. That being said, possibly, the info in this thread may be helpful.
    Last edited by loquin; 03-26-07 at 13:59.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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