Results 1 to 2 of 2

Thread: CodeBase-Visual basic

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Florida
    Posts
    213

    CodeBase-Visual basic

    Hello,

    How do I open a databe file using codebase/visual basic?

    Here is my code but it won't work

    --------------------------
    Sub Main()

    Dim i As Integer

    cb = code4init()

    If cb = 0 Then
    MsgBox "Failed to initialize.", 48, "Fatal Error"
    End If

    i = code4errOpen(cb, 0)

    some code
    frmServUpd.WindowState = 2
    frmServUpd.Show 1

    'close all input sources

    If cb <> 0 Then
    i = code4initUndo(cb)
    End if

    End Sub

    ----------------------------------------------

    Sub OpenDB(fn As String)

    Dim i As Integer
    Dim a As String, b As String
    Dim premTag As Long

    frmServUpd.MousePointer = 11
    frmServUpd.lblMsg1.Visible = True
    frmServUpd.Refresh

    'close currently open DB
    If DB <> 0 Then i = d4close(DB)

    'open new DB
    DB = d4open(cb, fn)
    If DB = 0 Then
    i = code4errorCode(cb, 0)
    b = "Failed to open " + fn
    MsgBox b, 48, "Error"
    MsgBox "Error code = " & Format$(i), 48, "Error"
    Exit Sub
    End If

    'init tag ordering
    premTag = d4tag(DB, "PREM_NUM")
    d4tagSelect DB, premTag

    'init field pointers
    fldptr(1) = d4field(DB, "counter")
    fldptr(2) = d4field(DB, "filename")
    fldptr(3) = d4field(DB, "prem_no")
    fldptr(4) = d4field(DB, "hse_range")
    fldptr(5) = d4field(DB, "street")

    'init field types
    InitFldPtrs

    CurrRecCount = d4recCount(DB) - 1

    frmServUpd.lblMsg1.Visible = False
    frmServUpd.MousePointer = 0

    'begin update loop
    PreLoadUpdates

    End Sub
    ---------------------------------

    Any help would be appreciated.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Florida
    Posts
    213
    help!!!

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