DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Problem with DAO

  1. #1
    Join Date
    May 2006
    Posts
    11

    Problem with DAO

    I have a program in VB that accesses FoxPro 2.5 tables which works fine. I have to use DAO 3.51, because 3.6 dropped the ISAM support for FoxPro tables and the ODBC driver has issues with the FoxPro 2.5 tables if they have null fields.

    I am currently creating some additional programs in PowerBASIC and in doing so I have come across an issue when updating a FoxPro 2.5 recordset using DAO. Calling the DAO update method results in the error "3001 Invalid Argument." This even occurs if I execute the Edit method and the Update method right after it. However, it works fine in VB6.

    Does anyone know if there are DAO parameters that VB sets in the background that would account for something like this?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Are you using a DAO datacontrol?

    Perhaps switching to using an SQL UPDATE query would be better.

  3. #3
    Join Date
    May 2006
    Posts
    11
    No, I don't use data controls.

    I was able to get DAO to work if I use late binding. For some reason early binding will not work.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Now that you have a solution, I have to ask...DAO???? Have you considered switching to ADO?

  5. #5
    Join Date
    May 2006
    Posts
    11
    For the sake of adding closure to this entry, I found that if I use early binding, if instead of executing the Update method I execute the x30_Update_ method I found in the declarations, the recordset successfully updates.

    As far as why I am using DAO, it has to do with two things.

    1. I have found that when performing similar functions with ADO and DAO, DAO is faster.
    2. Microsoft's changed FoxPro at some point around the time that they went to DAO 3.6. DAO 3.6 did not include the dBase installable ISAMS. The ODBC driver had an issue with older FoxPro tables that had null entries, but converting the older FoxPro tables to the new version cause issues with tons of our existing DAO code. I am currently in the process of moving to PostgreSQL, but I have projects that still have to be done with the old tables in the interim.

  6. #6
    Join Date
    Jun 2009
    Posts
    135
    3. One thing I have found using DAO ODBC Direct over ADO is that when it comes to memo type fields, with ADO one must use getchunck to retrieve all of the information from a *.dbf file while DAO retrieves all of the information/data for you....

  7. #7
    Join Date
    May 2006
    Posts
    11
    I don't really use that many memo fields. The issue I ran into had to do with the changeover of FoxPro when they changed how null values were handled.

    After the changeover, I don't remember the exact FoxPro version, there was an issue dealing with null values in FoxPro tables prior to that format. So if we used the ODBC driver and tried to save changes to a record that had null values that were unrelated to the changes being made it would error out. But, if we converted all of the tables to the new format, then all of our existing code that was using DAO and the jet engine failed to work.

    At this point I am moving everything to PostgreSQL, but I still have some interim projects that have to deal with the existing database format.

  8. #8
    Join Date
    Jun 2009
    Posts
    135
    Have you tried to use the 2.5/3.51 compatibility library? Also, your problem with the nulls, never had that problem but then again, I think I only go back to dbase 4 or 5 (yes dBase is what VFP is built on). Do you have an example table I could look at?

    Good Luck with the conversion...

Similar Threads

  1. CMR problem
    By vikassheelgupta in forum Java
    Replies: 0
    Last Post: 07-22-2005, 05:35 AM
  2. Java Applet Compiler problem?
    By mdl in forum Java
    Replies: 3
    Last Post: 03-07-2005, 03:34 AM
  3. Garbage collection and DAO transactions
    By Michael in forum .NET
    Replies: 3
    Last Post: 07-30-2002, 12:43 PM
  4. Replies: 0
    Last Post: 12-13-2001, 01:06 PM
  5. Replies: 0
    Last Post: 06-23-2000, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center