?
Solved

Creating a dbf file in using Visual Basic

Posted on 1999-07-29
7
Medium Priority
?
3,075 Views
Last Modified: 2013-11-25
I need to create a dbase format dbf file using Visual basic. I need instructions on doing so if it is possible.  I also need to be able to read a dbf file using visual basic.
0
Comment
Question by:geowilli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:BeedleGuis
ID: 1528444
why dbf?? do you need to open with dbase? if not just use a delimited file. .
0
 
LVL 1

Author Comment

by:geowilli
ID: 1528445
I need to create the dbf file since I am writing an interface program and the receiving application is expecting the file in that format.  I have absolutely no control over the receiving application.  I would really prefer sending my output to a text delimited file or an access database.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 200 total points
ID: 1528446
Why not use the DAO datacontrol.
Make Dbase V the provider of the datacontrol and
use code similar to this to create the database

Take a look at the CreateDatabase
Sub CreateDatabaseX()

      Dim wrkDefault As Workspace
      Dim dbsNew As DATABASE
      Dim prpLoop As Property

      ' Get default Workspace.
      Set wrkDefault = DBEngine.Workspaces(0)

      ' Make sure there isn't already a file with the name of
      ' the new database.
      If Dir("NewDB.mdb") <> "" Then Kill "NewDB.mdb"

      ' Create a new encrypted database with the specified
      ' collating order.
      Set dbsNew = wrkDefault.CreateDatabase("NewDB.mdb", _
            dbLangGeneral, dbEncrypt)

With dbsNew
            Debug.Print "Properties of " & .Name
            ' Enumerate the Properties collection of the new
            ' Database object.
            For Each prpLoop In .Properties
                  If prpLoop <> "" Then Debug.Print "    " & _
                        prpLoop.Name & " = " & prpLoop
            Next prpLoop
      End With

      dbsNew.Close

End Sub


Sub CreateTableDefX()

      Dim dbsNorthwind As Database
      Dim tdfNew As TableDef
      Dim prpLoop As Property

      Set dbsNorthwind = OpenDatabase("Northwind.mdb")

      ' Create a new TableDef object.
      Set tdfNew = dbsNorthwind.CreateTableDef("Contacts")

      With tdfNew
            ' Create fields and append them to the new TableDef
            ' object. This must be done before appending the
            ' TableDef object to the TableDefs collection of the
            ' Northwind database.

.Fields.Append .CreateField("FirstName", dbText)
            .Fields.Append .CreateField("LastName", dbText)
            .Fields.Append .CreateField("Phone", dbText)
            .Fields.Append .CreateField("Notes", dbMemo)

            Debug.Print "Properties of new TableDef object " & _
                  "before appending to collection:"

            ' Enumerate Properties collection of new TableDef
            ' object.
            For Each prpLoop In .Properties
                  On Error Resume Next
                  If prpLoop <> "" Then Debug.Print "    " & _

    prpLoop.Name & " = " & prpLoop
                  On Error GoTo 0
            Next prpLoop

            ' Append the new TableDef object to the Northwind
            ' database.
            dbsNorthwind.TableDefs.Append tdfNew

            Debug.Print "Properties of new TableDef object " & _
                  "after appending to collection:"

            ' Enumerate Properties collection of new TableDef
            ' object.
            For Each prpLoop In .Properties
                  On Error Resume Next
                  If prpLoop <> "" Then Debug.Print "    " & _

    prpLoop.Name & " = " & prpLoop
                  On Error GoTo 0
            Next prpLoop

      End With

      ' Delete new TableDef object since this is a
      ' demonstration.
      dbsNorthwind.TableDefs.Delete "Contacts"

      dbsNorthwind.Close

End SubSub CreateTableDefX()

      Dim dbsNorthwind As Database
      Dim tdfNew As TableDef
      Dim prpLoop As Property

      Set dbsNorthwind = OpenDatabase("Northwind.mdb")

      ' Create a new TableDef object.
      Set tdfNew = dbsNorthwind.CreateTableDef("Contacts")

      With tdfNew
            ' Create fields and append them to the new TableDef
            ' object. This must be done before appending the
            ' TableDef object to the TableDefs collection of the
            ' Northwind database.

.Fields.Append .CreateField("FirstName", dbText)
            .Fields.Append .CreateField("LastName", dbText)
            .Fields.Append .CreateField("Phone", dbText)
            .Fields.Append .CreateField("Notes", dbMemo)

            Debug.Print "Properties of new TableDef object " & _
                  "before appending to collection:"

            ' Enumerate Properties collection of new TableDef
            ' object.
            For Each prpLoop In .Properties
                  On Error Resume Next
                  If prpLoop <> "" Then Debug.Print "    " & _

    prpLoop.Name & " = " & prpLoop
                  On Error GoTo 0
            Next prpLoop

            ' Append the new TableDef object to the Northwind
            ' database.
            dbsNorthwind.TableDefs.Append tdfNew

            Debug.Print "Properties of new TableDef object " & _
                  "after appending to collection:"

            ' Enumerate Properties collection of new TableDef
            ' object.
            For Each prpLoop In .Properties
                  On Error Resume Next
                  If prpLoop <> "" Then Debug.Print "    " & _

    prpLoop.Name & " = " & prpLoop
                  On Error GoTo 0
            Next prpLoop

      End With

      ' Delete new TableDef object since this is a
      ' demonstration.
      dbsNorthwind.TableDefs.Delete "Contacts"

      dbsNorthwind.Close

End Sub
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:Saradhi
ID: 1528447
Send you e-mail address to saradhi@vsofti.stph.net

I have done an application where i am using foxpro files (dbf) and also creating them too.

I will give you the full fledged code.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1528448
I also have DIN and DOUT that convert ASCII to dBase-III and dBase-III to ASCII. I can give you source as well.

Here is QuickBasic-IV source to DIN that generates dBase-III compatible .DBF files:

' =========================================================
'
' ASCII/dBase-III file format converter
'
' Copyright 1990 - Mark M. Lambert - All Rights Reserved
'
' By:   Mark M. Lambert - November 15, 1990
'
' Version 2.02 - 5/5/94
'
' =========================================================
'
' Revision History:
'
' V2.04 - 18 Oct 96 - Fix byte ordering problem
' V2.03 -  9 Oct 96 - Tweak to support > 65,000 records
' V2.02 -  5/5/94  - Add online help
' V2.01 - 1/23/91  - Change maximum number of fields to 128
' V2.00 - 12/7/90  - Create valid dBase-III header
' V1.00 - 11/15/90 - Initial Code
'
' =========================================================
'
' This program will convert from ASCII
' CR/LF delimited field format to dBase-III's
' normal internal file format.
'
' Overall the minimum required layout of a D3 .DBF file
' is as follows.  The file is divided into three sections, the
' header, field definitions, and then the data area.  Each of these
' is, in turn, further subdivided.
'
' The header portion consists of 32 bytes in the following format:
'
'       Function        Size (bytes)    Typical Values
'       Marker          1               03
'       Year            1               5A (90)
'       Month           1               0C (12)
'       Date            1               07 (07)
'       Number of recs  4
'       Marker          2               E1 00 (?)
'       Record Length   4               Always even!
'       Pad fill        18              All zero's
'
' The field definition section varies in length with the number of
' fields that are defined.  Each field entry consisists of a 32 byte
' field descriptor in the following format:
'
'       Function        Size (bytes)    Typical Values
'       Field Name      10              Alpha-Num Uppercase ASCII
'       Pad             1               Zero
'       Type            1               C/D/L/M/N
'       Marker          4               Can be all zero's
'       Field Width     1
'       Decimal Places  1               Always zero unless type is N
'       Pad fill        14
'
' The field type character is always one of the following:
'
'       ID      Type            Notes
'       C       Character
'       D       Date            Width is always 8
'       L       Logical         Width is always 1
'       M       Memo            Width is always 10
'       N       Numeric
'
' Even though D3 can support all of these data types, all of the
' data generated by our stuff will always be of type character.  This
' will make life quite a bit simpler.
'
' After the field description, the end is indicated by a CR (0DH) in
' the first byte of what would normally be the first character of the
' next field description.  Once the field stuff is over, the acutal
' data area begins.  If there is an odd number of bytes in the actual
' record length, the first byte of the record will always be a space
' (20H) to make the record length even.
'
' All of the data is stored in ASCII just like it was entered.  The
' single exception to that is the date types that have the century
' added to them and are in YYYYMMDD format for ease of sorting and
' ordering.  Thus today (12/7/90) would be stored as 19901207.
' All fields are filled with spaces as pad fill.
'
' The ZPARSER program examines a ImageZ form file and will automatically
' create a descriptor file with the same name as the data file being created
' by the form.  This descriptor file has the extension .FLD and contains
' the comment lines from the field file on each file write.  At the end
' of this file is a count of the total number of fields found.  Using
' this clue, we can then search the generated data file to determine the
' maximum field lengths and construct a valid D3 header and data file - or
' at least that's the idea!
'
' =========================================================
'
' Subroutine and function declarations - Constant definitions
'
' These subs were generated with the SUBSET.BAS program and are in
' the IO.LIB sublibrary
'
DECLARE SUB cursor (row!, col!, text$)
DECLARE SUB center (row!, text$)
DECLARE SUB box (text$)
DECLARE SUB big.box (hi!)
DECLARE SUB menu (hi!, text$)
'
DECLARE FUNCTION getkey$ ()
'
COMMON urhc$, ulhc$, lrhc$, llhc$, hb$, vb$, tt$, bt$, rt$, lt$, cx$
COMMON xwide, top$, side$, horz$, bot$, cr$, lf$, ff$, esc$, bell$
'
urhc$   = CHR$(187)
ulhc$   = CHR$(201)
lrhc$   = CHR$(188)
llhc$   = CHR$(200)
hb$     = CHR$(205)
vb$     = CHR$(186)
tt$     = CHR$(203)
bt$     = CHR$(202)
rt$     = CHR$(185)
lt$     = CHR$(204)
cx$     = CHR$(206)
xwide   = 77
bar$    = string$(xwide, hb$)
top$    = ulhc$ + bar$ + urhc$
side$   = vb$   + STRING$(xwide, " ") + vb$
horz$   = lt$   + bar$ + rt$
bot$    = llhc$ + bar$ + lrhc$
cr$     = CHR$(13)
lf$     = CHR$(10)
ff$     = CHR$(12)
esc$    = CHR$(27)
bell$   = CHR$(7)
tab$    = CHR$(9)
quote$  = CHR$(34)
spc$    = " "
fw$     = ""
'
' Numeric Constants
'
CONST ZERO              = 0
CONST FALSE             = ZERO
CONST TRUE              = NOT FALSE
'
CONST INFILE            = 1
CONST OUTFILE           = 2
CONST FLDFILE           = 3
'
CONST MAX.FIELDS        = 128
'
' Field and length storage
'
dim item.list$(max.fields)
dim item.len(max.fields)
'
' Parameters for creation of new file
'
flds    = zero
fld.type$       = "C"
rec.len = zero
rec.count#       = zero
'
' Seed field name list
'
      for index = 1 to max.fields
      item.list$(index)       = "FIELD_" + right$("00000" + ltrim$(str$(index)), 4)
      item.len(index)         = zero
      next index
'
width lprint 255
'
' =========================================================
'
' Declaration section is out of the way - now we can have
' some executable code
'
Main:
if (ucase$(left$(environ$("CRT"), 1)) = "M") then
      color 7, 0
else
      color 7, 1
endif
'
call menu(3, "ASCII/dBase-III Data File Converter - V2.03")
filespec$ = ucase$(command$)
if (len(filespec$) > zero) then goto skip.init
'
call center(5, "Copyright 1990 - M. Lambert - All Rights Reserved")
call cursor(7, 10, "ASCII data (.DAT) file to convert: <filespec> ? ")
line input a$
filespec$       = ucase$(ltrim$(a$))
pnt             = instr(filespec$, ".")
if (pnt   > zero) then a$ = left$(a$, pnt - 1)
if (len(a$) = zero) then goto drain
'
skip.init:
'
marker = instr(filespec$, "?")
if ( marker = 0 ) goto nohelp
'
call menu(17, "DIN Online help - Page 1 of 3")
call cursor( 5, 5, "DIN will convert an ASCII data file (.DAT) into a dBase-III file (.DBF).")
call cursor( 7, 5, "In order to accomplish this you must make a small field description file")
call cursor( 8, 5, "that contains the names of the fields that are to be created and a count")
call cursor( 9, 5, "of the total number of fields in each record. The .FLD file format has")
call cursor(10, 5, "one line for each field. Each line starts with a single quote followed")
call cursor(11, 5, "by the name of the field. Each field name must be unique. Invalid")
call cursor(12, 5, "characters in the field name are automatically stripped.")
call cursor(14, 5, "The last line in the file consists of a marker with a five digit count")
call cursor(15, 5, "of the total number of fields in each record. A typical .FLD file might")
call cursor(16, 5, "appear as:")
call cursor(18, 15, "'name")
call cursor(19, 15, "'address")
call cursor(20, 15, "'Phone")
call cursor(21, 15, "#3")
q$ = getkey$
call menu(15, "DIN Online help - Page 2 of 3")
call cursor( 5, 5, "All of the data will be converted to CHARACTER data types.")
call cursor( 7, 5, "The program will scan the file prior to starting the actual conversion.")
call cursor( 8, 5, "This scan is to determine the maximum width of the data fields. Once the")
call cursor( 9, 5, "scan is complete the conversion will occur. As each record is being")
call cursor(10, 5, "converted a status counter and an excerpt of the data will be displayed.")
call cursor(12, 5, "An error message will be generated if the input data file does not end")
call cursor(13, 5, "on an even record boundary.")
call cursor(15, 5, "The name of the .FLD and the resulting .DBF file will be the same as the")
call cursor(16, 5, "original .DAT file.")
call cursor(18, 5, "You can specify the name of the .DAT/.FLD/.DBF file on the command")
call cursor(19, 5, "line when the program is first run. No extension should be used.")
q$ = getkey$
call menu(17, "DIN Online help - Page 3 of 3")
call cursor( 5, 5, "If you run the program without a file name on the command line,")
call cursor( 6, 5, "it will prompt you for one.")
call cursor( 8, 5, "This program has a single command line switch: `?'")
call cursor( 9, 5, "Entering this on the command line or in place of the file name")
call cursor(10, 5, "will display these help screens.")
call cursor(12, 5, "This program is also sensitive to the state of the CRT")
call cursor(13, 5, "system environment variable. If this variable is set to `C'")
call cursor(14, 5, "then the program will display white text on a blue background.")
call cursor(15, 5, "Omitting this variable or setting it to any other value will")
call cursor(16, 5, "cause the program to display white text on a black background.")
call cursor(18, 1, horz$)
call center(20, "This program was written by Mark M. Lambert in 1990 and is")
call center(21, "hereby placed in the public domain.")
q$ = getkey$
goto drain
' =====================================
'
nohelp:
cls
call box("Processing file: " + filespec$ + ".DAT")
'
testfile$ = filespec$
gosub check.file
'
' Exit if trouble with file
'
if (error$ <> "") then goto terminus
'
' INFILE is the handle of our input data file, while
' FLDFILE is the handle of the description file created by ZParser
'
' Lets determine the correct name for each field and the total number of
' fields
'
desc.loop:
      if eof(fldfile) then goto error.in.data1
'
      line input #fldfile, text$
      if (left$(text$, 1) = "'") then goto got.name
'
      if (left$(text$, 1) = "#") then goto got.length
'
' Actually we should never get here, but if we do we'll just read & ignore
' data!
'
      goto desc.loop
' =================
'
' We get here on field names.  Strip out spaces and use as
' a file name.
'
got.name:
      if (len(text$) < 1) then goto dupe
'
      text$ = right$(text$, len(text$) -1)
      text$ = ucase$(ltrim$(rtrim$(text$)))
      if (len(text$) > 10) then text$ = left$(text$, 10)
'
' Strip out non printables
'
            for index = 1 to len(text$)
            byte$ = mid$(text$, index, 1)
            if (byte$ < "0") then mid$(text$, index, 1) = "_"
            next index
'
' When we get here the field name has been formatted
'
no.spaces.left:
      flds = flds + 1
      if (flds > max.fields) then goto overflow
'
      if (len(text$) = 0) then goto dupe
'
            for index = 1 to flds
            if (item.list$(index) = text$) then goto dupe
'
            next index
'
      item.list$(flds) = text$
'
dupe:   goto desc.loop
' =================
'
' We get here on record counts - last record in file
'
got.length:
if (len(text$) < 1) then goto dupe
'
text$           = right$(text$, len(text$) -1)
fld.count       = int(abs(val(text$)))
if (flds <> fld.count) then goto error.in.data
'
close fldfile
'
' Ok, we've sucessfully read the field descriptions into the
' arrays and everything seems to be both hunky & dory.  Now
' we'll do a fast scan on the data file watching the maximum length
' for each field.
'
rec.count# = 0
'
search.loop:
      rec.count# = rec.count# + 1
      call center(1, "Scanning record #" + str$(rec.count#))
'
            for index = 1 to flds
            if eof(infile) then goto no.more.in.search
'
            line input #infile, text$
            text$ = ucase$(ltrim$(rtrim$(text$)))
            t.len = len(text$)
            if (t.len > item.len(index)) then item.len(index) = t.len
            next index
'
goto search.loop
' =================
'
' We get here after searching the data file to determine the
' maximum number of characters in each field.
'
' At this point we have the number of records in rec.count# and the
' maximum length of each field in ITEM.LEN().  From before we also
' have the field names in ITEM.LIST$().  Now lets use this to create
' a D3 file header in three parts.
'
no.more.in.search:
call center(1, bar$)
call center(7, bar$)
call center(1, "Creating file header . . .")
close infile
open file.root$ + ".DAT" for input as #infile
open file.root$ + ".DBF" for binary as #outfile
'
' Ok, lets see if we can write the file header
'
byte$ = chr$(3)
put #outfile,,byte$
byte$ = chr$(0)
put #outfile,,byte$
put #outfile,,byte$
put #outfile,,byte$
'
' Got a 32 bit value here that we need to write a byte at a time
'
tgr# = rec.count# - 1
'
' First split into MS & LS words
'
lsh = int(tgr# mod 65536)
msh = int(tgr#  /  65536)
'
' Split each word into bytes
'
lsh1% = int(lsh mod 256)
lsh2% = int(lsh  /  256)
'
msh1% = int(msh mod 256)
msh2% = int(msh  /  256)
'
' Write the bytes bassdackwards intel byte numbering convention
'
byte$ = chr$( lsh1% )
put #outfile,,byte$
'
byte$ = chr$( lsh2% )
put #outfile,,byte$
'
byte$ = chr$( msh1% )
put #outfile,,byte$
'
byte$ = chr$( msh2% )
put #outfile,,byte$
'
' Ummm, we need to watch out for zero length fields & drop them from
' the data list
'
true.fld.count = 0
      for index = 1 to flds
      if (item.len(index) > 0) then true.fld.count = true.fld.count + 1
      next index
'
' Ok, this next word is a pointer to where the first byte of
' data can be found in the record.  We count the number of fields
' times 32 + 32 for the header + 1
'
intgr% = 32 * true.fld.count + 32 + 1
put #outfile,,intgr%
'
' Compute record length
'
rec.len = 1
      for index = 1 to flds
      rec.len = rec.len + item.len(index)
      next index
'
intgr% = rec.len
put #outfile,,intgr%
intgr% = zero
      for index = 1 to 10
      put #outfile,,intgr%
      next index
'
' Ok, we've built the first part of the file, now lets tack on the field
' names and their data.
'
call center(1, bar$)
call center(1, ". . . creating field definitions . . .")
      for index = 1 to flds
      if (item.len(index) = 0) then goto bypass
'
      call center(7, bar$)
      call center(7, ". . . defining field " + item.list$(index) + " . . .")
      put #outfile,,item.list$(index)
      byte$ = chr$(0)
            for pad = 1 to 11 - len(item.list$(index))
            put #outfile,,byte$
            next pad
      put #outfile,,fld.type$
      intgr% = zero
      put #outfile,,intgr%
      put #outfile,,intgr%
      intgr% = item.len(index)
      put #outfile,,intgr%
      intgr% = zero
            for sub.index = 1 to 7
            put #outfile,,intgr%
            next sub.index
'
bypass:
      next index
'
' Last byte is cr
'
put #outfile,,cr$
'
' Ok, we've sucessfully built the file header, lets see what else we need
'
call center(1, bar$)
call center(7, bar$)
if (rec.count# < 1) then goto skip.copy
'
      for index = 1 to rec.count#
      call center(1, "copying record" + str$(index) )
      put #outfile,,spc$
            for sub.index = 1 to flds
            if eof(infile) then goto another.error
'
            line input #infile, text$
            text$ = ltrim$(text$)
            call cursor(9, 1, string$(79, spc$))
            call cursor(9, 1, left$(text$, 79))
            text$ = left$(text$ + string$(item.len(sub.index), spc$), item.len(sub.index))
            put #outfile,,text$
            next sub.index
'
      next index
'
' Finish up with a nice <CTRL Z>
'
skip.copy:
byte$ = chr$(26)
put #outfile,,byte$
'
close
'
Drain:
cls
'
terminus:
system
' =====================================
'
' Assorted minor error traps
'
' We get here on trash in our datafiles
'
another.error:
if (sub.index = 1) then goto skip.copy
'
close
error$ = "Data file does not end on a record boundary!"
'
error.common:
gosub error.trap
goto terminus
' =================
'
' More than MAX.FIELDS fields
'
overflow:
error$ = "Too many fields to process !"
goto error.common
' =================
'
' Field count in .FLD file doesn't match what we computed  
'
error.in.data:
error$ = "Incorrect field count in .FLD file !"
goto error.common
' =================
'
' Abnormal end of field file
'
error.in.data1:
error$ = "Abnormal end of .FLD file !"
goto error.common
' =================
'
nope:
resume next
' =====================================
'
' Error trap
'
error.trap:
call box("ERROR:  " + tab$ + error$)
return
' =========================================================
'
' Subroutines
'
' =========================================================
'
' We get here with a file name embedded into TESTFILE$
'
' Check for wild card and if not, see if file exists
'
' Pass: Filename in TESTFILE$
'
' Returns:      File extension (including the dot) in EXTENSION$
'
check.file:
file.id$        = ""
extension$      = "*"
if (left$(testfile$, 1) = "*") then goto skip.this
'
extension$      = ""
'
      for index = 1 to len(testfile$)
      test.char$ = mid$(testfile$, index, 1)
      if (test.char$ < spc$) then goto got.end
'
      file.id$ = file.id$ + test.char$
      next index
'
' Ok, the filename has been stripped out
'
got.end:
file.id$        = ucase$(file.id$)
file.root$      = file.id$
dot             = instr(file.id$, ".")
if (dot > one) then _
            extension$ = right$(file.id$, len(file.id$) - dot + 1) :_
            file.root$ = left$(file.id$, dot - 1)
'
' Open file and determine length
'
on error goto not.found
open file.id$ + ".DAT" for input as #infile
on error goto 0
goto file.exists
' =======
'
not.found:
resume not.found1
'
not.found1:
on error goto 0
error$ = "Requested file " + file.id$ + ".DAT not found!"
gosub error.trap
goto skip.this
' =================
'
not.found.fld:
resume not.found.fld1
'
not.found.fld1:
on error goto 0
error$ = "Requested file " + file.id$ + ".FLD not found!"
gosub error.trap
goto skip.this
' =================
'
file.exists:
'
' Open configuration file and determine length
'
on error goto not.found.fld
open file.id$ + ".FLD" for input as #fldfile
on error goto 0
error$ = ""
'
skip.this:
return
' =====================================
'
' Null placeholders for test
'
null:
'
return
' =========================================================
' =========================================================
'
' Fin
'
' =========================================================
' =========================================================

0
 
LVL 1

Author Comment

by:geowilli
ID: 1528449
I am sorry I have been away for a while.  
I have not had a chance to evaluate your answer but I am granting you the points anyway.  Thanks for your patience.
0
 
LVL 1

Expert Comment

by:Un1
ID: 6326784
VB source code xBase database file engine:

http://www.banasoft.com/DownLoad/BNxBase.exe

Banasoft xBase Object is a powerful database engine with small size, high performance, easy to use and compatible to dbase file format.

Some times we need a small database to store our data but do not want to use the Microsoft's large database system. xBase is less then 128kb for binary or 64kb for source code. You can build and distribute small application with database support.

Although it's small in size, xBase object provides a powerful Filter property, You can select records from database almost in the same way just like SQL. You can add comparisons, math functions in the filter expression to implement complex query. We expand the memory field store method, now you can store strings, byte arrays even if objects, and get it back easily.

xBase object uses the dBASEIV file format to store data. You can export or import the data to Access or other standard database engine, this make data exchange between different databases become very easy. In additional, xBase object can read and write almost all of the xBase format files under certain conditions.

xBase object also has an interface just like Microsoft's ADO, MoveFirst, EOF, EditMode, Filter, RecordCount, AddNew, Update, Delete and so on. It behaves like a Recordset object, You can program it with the ADO grammar familiar to you.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question