Results 1 to 2 of 2

Thread: Creating Foxpro, Paradox DB

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    4
    hey great programmers!
    Can anyone of you tell me how can I create a new Foxpro or paradox databaes useing VB.

    Thanx

  2. #2
    New Member
    Join Date
    May 2000
    Posts
    2

    Lightbulb

    > Can anyone of you tell me how can I create a new
    > Foxpro or paradox databaes useing VB.

    'If you are using DAO, you do it like this:

    DIM db as dao.database
    DIM rs as dao.recordset
    DIM S as String
    DIM Tablename as String


    ' For foxpro, you open a directory as the database
    Set DB = Workspaces(0).OpenDatabase("C:\Directory", False, False, "Foxpro 3.0")

    TableName = "SOME_TABLE"

    S = "CREATE TABLE "&Tablename & _
    " (A TEXT(4), B INTEGER )"

    DB.EXECUTE S

    ' Now that the table is open, write records

    Set RS = DB.OpenRecordset(TableName & ".DBF")

    rs.addnew
    RS!A = "ABCD" ' or RS.FIELDS("A")="ABCD"
    RS!B = 5 ' or RS.FIELDS("B")=5
    rs.update

    ' More things...

    rs.close
    db.close

    Paul Robinson <A HREF="mailto:[email protected]">[email protected]</A><BR><A href="http://paul.washington.dc.us">paul.washington.dc.us</A>


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