CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Location
    Iowa, USA
    Posts
    197

    connection string info

    Hey all, I was wondering if any of you know the ADO connection string for a foxpro(.dbf) database/table. I've been use DAO and its pretty straight forward there, but I'm having a **** of a time migrating to ADO. I can't seem to get dbf's to work at all, and that pretty much all we use here at work.

    I've tried
    Code:
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
            "Data Source=N:/PERSONAL/awilliams/basic/;" & _
            "Extended Properties=dBASE IV;"     & _
            "User ID=Admin;Password="
    where n:/personal/awilliams/basic/ is the folder with my dbf's.

    I get "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." error.

    Any suggetions would be much appreciated.

  2. #2
    Join Date
    May 2004
    Location
    45,000FT Above Nevada
    Posts
    1,539

    Re: connection string info

    Give this link a look I think you'll find the correct syntax here...good luck..let me know if it works..

    This Page
    Jim
    ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII

    "The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.

    "Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.

  3. #3
    Join Date
    Jun 2002
    Location
    West Virginia
    Posts
    131

    Re: connection string info

    I'm new at database programing but don't you need the database name in:
    "Data Source=N:/PERSONAL/awilliams/basic/;"
    i.e.
    "Data Source=N:/PERSONAL/awilliams/basic/MYDATABASE.DBF;"
    Wayne

  4. #4
    Join Date
    Sep 2004
    Location
    Iowa, USA
    Posts
    197

    Re: connection string info

    Heres what I got...

    I went to the web site and went to the VFP section and downloaded the OLE DB provider (which evidently doesn't install with VFP??). Then I generated a connection string and, whoop, there it is.

    This is the string I got:

    Code:
    Provider=VFPOLEDB.1;Data Source=N:\personal\awilliams\basic;Password="";
    Collating Sequence=MACHINE
    Thank you for all your help.

  5. #5
    Join Date
    Sep 2004
    Posts
    247

    Re: connection string info

    If I can never remember a connection string, a good place to look is http://www.connectionstrings.com/

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

Featured