Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


VB 6.0 and btrieve api HELP !!!!!!

VB 6.0 and btrieve api HELP !!!!!!

All i am trying to do is setup a btrieve api call to just get all the records in a btrieve file. i am getting an error when calling the BGETFIRST.  i doing this in VB 6.0, please help.  here is my code:

These are my UDTS:

Type RecordBuffer
    Junk1 As String * 6
    MilID As String * 10
    MilNumber As String * 2
    MilSymbol As String * 1
    MilDesc As String * 40
    MilWeight As String * 8
    MilSchedDate As Long
    MilForcastDate As Long
    MilCompleteFlag As String * 1
    MilPctComplete As String * 3
    MilWBS As Long
    Junk2 As String * 7
End Type

Type RecordBufferByte
    Junk1 As String * 6
    MilID As String * 10
    MilNumber As String * 2
    MilSymbol As String * 1
    MilDesc As String * 40
    MilWeight As String * 8
    MilSchedDate As typLongArr
    MilForcastDate As typLongArr
    MilCompleteFlag As String * 1
    MilPctComplete As String * 3
    MilWBS As typLongArr
    Junk2 As String * 7
End Type

Here is my function:

Function TestCalls()
    Dim FileName As String, PosBlk As Variant, KeyBuffer As String, KeyBufLen As Integer
    Dim KeyNum As Integer, Status As Integer, BufLen As Integer
    Dim DataBufVB As RecordBuffer
    Dim DataBufBT As RecordBufferByte
    FileName = CurrentProject.Path & "\"
    PosBlk = Space$(128)
    KeyBuffer = Space$(KEY_BUF_LEN)
    'Open File
    KeyBufLen = KEY_BUF_LEN
    KeyBuffer = FileName
    BufLen = Len(DataBufBT)
    KeyNum = 0
    Status = BTRCALL(BOPEN, PosBlk, DataBufBT, BufLen, ByVal KeyBuffer, KeyBufLen, KeyNum)
    If Status <> 0 Then Stop
    BufLen = Len(DataBufBT)
    KeyBuffer = Space$(255)
    KeyBufLen = KEY_BUF_LEN
    Status = BTRCALL(BGETFIRST, PosBlk, DataBufBT, BufLen, ByVal KeyBuffer, KeyBufLen, 0)
    If Status <> 0 Then Stop
    DataBufVB.Junk1 = DataBufBT.Junk1
    DataBufVB.Junk2 = DataBufBT.Junk2
    DataBufVB.MilCompleteFlag = DataBufBT.MilCompleteFlag
    DataBufVB.MilDesc = DataBufBT.MilDesc
    DataBufVB.MilID = DataBufBT.MilID
    DataBufVB.MilNumber = DataBufBT.MilNumber
    DataBufVB.MilPctComplete = DataBufBT.MilPctComplete
    DataBufVB.MilSymbol = DataBufBT.MilSymbol
    DataBufVB.MilWeight = DataBufBT.MilWeight
    CopyMemory DataBufBT.MilForcastDate, ByVal DataBufVB.MilForcastDate, 4
    CopyMemory DataBufBT.MilSchedDate, ByVal DataBufVB.MilSchedDate, 4
    CopyMemory DataBufBT.MilWBS, ByVal DataBufVB.MilWBS, 4
End Function

RE: VB 6.0 and btrieve api HELP !!!!!!

You did not mention what error you were getting.


RE: VB 6.0 and btrieve api HELP !!!!!!

my bad!!!!  but since the time i posted this i was able to solve my problem but now i have a new one.  i will post that in a new thread.  thanks!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close