MOTOBIT.COM - ASP upload, IIS utility Define exact DBF output format

Sample for RSConvert.DBF.GetFile | Changes | Purchase | Download


Define exact DBF output format 
Sub SimpleDBFTest()
  '1. Create simple recordset.

  Const adDate = 7
  Const adSingle = 4
  Dim RS: Set RS = CreateObject("ADODB.Recordset")
  RS.Fields.Append "Date", adDate
  RS.Fields.Append "Single", adSingle
  AddDate RS, #1/1/1900#, 568.256
  AddDate RS, #1/1/1950#, 235.28
  AddDate RS, #1/1/1990#, 18.34
  AddDate RS, #1/1/1999#, 1234.58
  AddDate RS, #1/1/2000#, 1.25
  AddDate RS, #1/1/2020#, 4568.598
  AddDate RS, #1/1/2200#, 458774.23

  Dim dbf 'As RSConvert.dbf
  '2. Create DBF object
  Set dbf = CreateObject("RSConvert.DBF")
  '3. get DBF as binary contents.
  Dim BinaryContents
  BinaryContents = dbf.GetFile(RS, , Array("DateField", "D", Empty, Empty, "NumField", "N", 4, 1))
  '4. Send the file to the client.
  Response.BinaryWrite BinaryContents


End Sub

Sub AddDate(ByRef RS, ByVal D, N)
  RS("Date") = D
  RS("Single") = N
End Sub

Other links for the Define exact DBF output format sample


Object for converting DAO or ADO recordset to the DBF file. It enables direct output of DBF files from the ASP page.


      Recordset converter is a library for converting DAO or ADO recordsets to MDB or DBF files. It enables direct binary output of MDB or DBF files from ASP pages with one row of code. The object also supports on-the-fly compression by zip/arj.

© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: