Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2004, 12:15 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening ,dbf file through ADO in VB6?

Hello,

I am trying to open a Dbase File using VB6 ADODB connection. I am getting this error message: "Path is not a valid path. Make sure that the path is spelled correctly and that you are connected to the server on which the file resides."

I know and know that the 2 conditions are met. The code is as follows:
___________

Private Sub Form_Load()

Dim Conn
  Set Conn = CreateObject("ADODB.Connection")
   Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\CUSTOMER.DBF;Extended Properties=DBASE IV"
End Sub

___________
I know you can open dbf with ADO. and as far i can see in the documentation, the 'extented properties' paremeter is important, i tried the above and also tried one other format:

... Extended Properties=""DBASE IV;"";"

and that gave the same error message.

I can open the dbf file easily from a DAO control, by specifying the table name in 'recordsource' and 'dbase IV' in Connect property; but I want to do it in ADO so i can have more flexibility in controlling the record source at run time.

Thank you for any input,

Regards and God bless
vchell
 
Old September 11th, 2007, 03:40 AM
Bvu Bvu is offline
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub Form_Load()

Dim Conn
  Set Conn = CreateObject("ADODB.Connection")
   Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=DBASE IV"
End Sub

Replace c:\CUSTOMER.DBF with c:use CUSTOMER.DBF as table name in your query

B for Bibhu
 
Old September 11th, 2007, 03:43 AM
Bvu Bvu is offline
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub Form_Load()

Dim Conn
  Set Conn = CreateObject("ADODB.Connection")
   Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=DBASE IV"
End Sub

Replace c:\CUSTOMER.DBF with c:use CUSTOMER.DBF as table name in your query

B for Bibhu





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I read a DBF file rtr1900 Classic ASP Databases 2 August 13th, 2007 12:36 PM
Closing an ADO connection to a .DBF file tknnguyen Pro VB 6 2 July 25th, 2007 01:49 PM
Webservice opening dbf JuneCleaver ADO.NET 2 January 14th, 2004 06:51 AM
How to Use foxpro's DBF file cbpanchal VB How-To 0 September 12th, 2003 03:27 AM
How to connect .dbf file with ADO & DAO with code cbpanchal VB How-To 4 July 28th, 2003 10:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.