Results 1 to 13 of 13

Thread: What is .DBF, .MDX file?? How to open it to modify??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    What is .DBF, .MDX file?? How to open it to modify??

    I have a file User.DBF, User.MDX but don't know how to open it to modify...

    I have some research about the file extension.. but the result return is "Database IV"...

    I try to use Visual Basic 6.0 to connect and open it to add new column but fail....

    Code:
    Dim foldername As String
    foldername = "C:\Documents and Settings\Programmer\Desktop\Data"
    
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & foldername & ";Extended Properties=dBase IV;"
    
    Conn.Execute ("ALTER TABLE User ADD TotalAccess char(255)")
    Run-time error
    Code:
    Operation not supported on the table that contains data.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: What is .DBF, .MDX file?? How to open it to modify??

    Try using a foxpro driver.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: What is .DBF, .MDX file?? How to open it to modify??

    It's not "Database IV" ... it is "dBase IV" ... it's a database system, like FoxPro, Access, SQL Server, Oracle, etc. If you've got MDAC installed, odds are you've got what you need to read the file in. Try using a connection string something like this:
    Code:
    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password=;
    naturaly, the path to the file and the user ID, password will need to be changed.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    but why I keep having the "Operation not supported on the table that contains data." run-time error when I try to add new column to the .DBF file..

    I can open the database and retrieve the data properly using the following... just cannot add new column...

    Code:
    Dim foldername As String
    foldername = "C:\Documents and Settings\Programmer\Desktop\Data"
    
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & foldername & ";Extended Properties=dBase IV;"
    
    Dim sql as string
    Dim rs as new ADODB.Recordset
    
    sql="Select * FROM User"
    rs.open sql, Conn
    
    If rs.BOF = False Then
     xxxxxx
     xxxxxx
    End If
    rs.Close

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: What is .DBF, .MDX file?? How to open it to modify??

    How are you adding the column? Did you ensure that there are no locks on the table (or table is not in use by databound controls) when column is being added?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    I attachment my DBF file...

    I can update and delete record properly... only cannot alter add new column...

    I don't wether the DBF file is lock or not...
    Attached Files Attached Files

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    I even use the foxpro driver..
    Conn.Open "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & foldername & ";Exclusive=No; Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;"

    but still the same...

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: What is .DBF, .MDX file?? How to open it to modify??

    it maybe a limitation of the driver.... once there is data in the table, the table cannot be altered... at least not by using this method. You may have to get a copuy of dBase IV or FoxPro to do the actual table alter.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    I already try to delete all the User.dbf data... but still the same runtime error

    Code:
    "Operation not supported on the table that contains data."
    if I try using the visual FoxPro driver.... I get the other runtime error...

    Code:
    Conn.Open "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & foldername & ";Exclusive=No; Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;"
    
    Conn.Execute ("ALTER TABLE V53User ADD TotalAccess char(255)")
    Runtime error
    Code:
    [Microsoft][ODBC Visual FoxPro Driver]Not a table.

  10. #10
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: What is .DBF, .MDX file?? How to open it to modify??

    Not a table error - Your use of Jet driver may have caused the table header record count info not to match with actual record count.

    You might have to recreate the table (new table with added column) using foxpro and import data from the old table.

  11. #11
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: What is .DBF, .MDX file?? How to open it to modify??

    and when we say "with foxpro" we don't mean with the FoxPro driver... but with FoxPro itself...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    I been use the Microsoft Visual FoxPro s/w to open the User.dbf... but it also prompt "Not a Table" error

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    Re: What is .DBF, .MDX file?? How to open it to modify??

    I try to create my own MS Access (.mdb) file and the column ready...

    but when I want to export it to DBase IV datatype... the MS Access keep prompt me the "Cannot define field more than once." error...

    I try to remove the last four column and it work.... what's the problem???
    Attached Files Attached Files

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