Click to See Complete Forum and Search --> : connection string info


spuppett
October 27th, 2004, 03:17 PM
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

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.

Vanaj
October 27th, 2004, 04:58 PM
Give this link a look I think you'll find the correct syntax here...good luck..let me know if it works..

This Page (http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMicrosoftJet)

WayneS
October 28th, 2004, 08:27 AM
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

spuppett
October 28th, 2004, 12:35 PM
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:


Provider=VFPOLEDB.1;Data Source=N:\personal\awilliams\basic;Password="";
Collating Sequence=MACHINE


Thank you for all your help.

Davey
October 29th, 2004, 04:03 AM
If I can never remember a connection string, a good place to look is http://www.connectionstrings.com/