Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 22nd, 2008, 09:03 PM
Registered User
Join Date: Aug 2008
Location: Ottawa, Ontario, Canada.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to link FoxPro Table with VB

Hi all,

Could you please help me in finding a way to connect to a foxpro table from VB, my table is with .dbf extension and not .dbc. Also I am trying to understand how to use the: dataAdapter, DataSet and GridView to can display all the records of that table inside a VB Windows form.


Reply With Quote
  #2 (permalink)  
Old September 21st, 2008, 12:30 PM
Authorized User
Join Date: Nov 2006
Location: Bangalore, Karnataka, India.
Posts: 31
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas

i believe you are not using VB 6.0

Reply With Quote
  #3 (permalink)  
Old September 14th, 2009, 09:26 AM
Registered User
Join Date: Sep 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts

    Dim sFolder As String:          sFolder = App.Path
    Dim sTable_ As String:          sTable_ = "base_fox"    ' base_fox.dbf
    Dim cnn As ADODB.Connection:    Set cnn = New ADODB.Connection
    Dim rst As ADODB.Recordset:     Set rst = New ADODB.Recordset

    cnn.Provider = "VFPOLEDB.1"
    cnn.Properties("Data Source") = sFolder                 ' or   sFolder & "\" & bas_fox.dbc
    rst.Open "SELECT * FROM " & sTable_, cnn
    If Not rst.EOF Then
        MsgBox rst.Fields(0)
    End If
    rst.Close:  Set rst = Nothing
    cnn.Close:  Set cnn = Nothing
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking to a Foxpro Table DavidWE Access VBA 0 July 18th, 2008 02:26 PM
Link FoxPro tables through OLEDB catudalg Access 2 May 8th, 2007 08:16 AM
Exporting Oracle Table to .dbf (FoxPro 2.6) File syamchandr Oracle ASP 2 December 12th, 2005 04:43 AM
How to use foxpro dbf with vb cbpanchal VB Databases Basics 2 November 13th, 2004 11:48 AM
Update SQL table with data from FoxPro system sofya SQL Server 2000 6 November 4th, 2004 06:45 PM

All times are GMT -4. The time now is 07:00 PM.

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