locked
Reading DBF files with different extensions RRS feed

  • Question

  •  

    Hi all,

     

    We have dbf files with different extensions (like SCD,ID7) for identification purpose.

    I am reading dbf files with different extensions, i am using the following the connectioin string

     

    Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=D:\database files folder\;

     

    I can read the dbf files with different extensions using a console application using the following select statement

     

    SELECT * FROM 10752247.ID7 WHERE ....

     

    But the i cant use the same select statement with in a windows service, i am just trying to read dbf file when created using a file watcher event. changing the file extension to dbf its working like this,

     

    SELECT * FROM 10752247.dbf WHERE ....

     

     But i dont want to change the extension and i am receiving the following exception message...

     

    ERROR [42S02] [Microsoft][ODBC dBase Driver] The Microsoft Jet database engine could not find the object '10752247.ID7'. Make sure the object exists and that you spell its name and the path name correctly.

     

    is there any issue in the connection string or in the select statement, i have also tried using the Administrator account for the service still same issue..

     

    Please give me a solution/suggestion.

     

    Thanks,

    Karthick G.

    Tuesday, May 22, 2007 9:06 AM

Answers


  • This is by design. If you use this driver then you're limited to the .dbf file extension. You could rename the file temporarily, on the fly, or maybe try one of the FoxPro drivers.
    Tuesday, May 22, 2007 2:00 PM
  • Hi Karthick,

     

    Please try the FoxPro and Visual FoxPro OLE DB data provider, downloadable from http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx . A typical connection string is like connString = "Driver=VFPOLEDB.1;Data Source=C:\My Data Folder\;"

    Tuesday, May 22, 2007 4:26 PM

All replies


  • This is by design. If you use this driver then you're limited to the .dbf file extension. You could rename the file temporarily, on the fly, or maybe try one of the FoxPro drivers.
    Tuesday, May 22, 2007 2:00 PM
  • Hi Karthick,

     

    Please try the FoxPro and Visual FoxPro OLE DB data provider, downloadable from http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx . A typical connection string is like connString = "Driver=VFPOLEDB.1;Data Source=C:\My Data Folder\;"

    Tuesday, May 22, 2007 4:26 PM
  • Hi cindy,

     

    Thanks for the reply, i have tested with the FoxPro and OLE DB Provider and its working both inside a console application and Window service.

     

    But i wonder why i cant do the same with ODBC, remember i can read a non .DBF file with different extension in a normal console application and not inside a windows service. Why ?

     

    waiting for your reply,

     

    Thanks and regards,

    Karthick G.

    Wednesday, May 23, 2007 8:25 AM
  •  Karthickg wrote:

     

    ....But i wonder why i cant do the same with ODBC, ....

     

    Hi Karthick,

     

    All I can tell you is that the ODBC drivers haven't been updated since Visual Studio 6. The VFP OLD DB data provider is updated for VFP9.

    Wednesday, May 23, 2007 12:06 PM
  • Visual FoxPro is a great solution for this problem. Only when your datafile contains huge amount of records (about 1 million) it's very very slow!

    Is it also possible to use the Microsoft Jet-Engine for that problem???
    • Edited by CodeResearcher Thursday, December 3, 2009 10:52 AM substitution
    Thursday, December 3, 2009 10:52 AM