Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Accessing VFP 8 tables

 
   Database Help (Home) -> Visual Basic RSS
Next:  Recordset trims values  
Author Message
Utf-8BUmljaEc

External


Since: May 21, 2004
Posts: 8



(Msg. 1) Posted: Fri May 21, 2004 9:01 pm
Post subject: Accessing VFP 8 tables
Archived from groups: microsoft>public>vb>database (more info?)

I posted this in the VFP area but I think it may be more for this area.
How do you access Visual FoxPro 8 files in VB 5 or 6. The ODBC drivers
do not seem to work so I downloaded a new vfpoledb.dll file. It did
not help. It seems I need to use OLE DB but I've never used it before.
So before I get on the learning curve for something that may not work,
can anyone point me in the right direction?

 >> Stay informed about: Accessing VFP 8 tables 
Back to top
Login to vote
Cindy Winegarden

External


Since: Oct 02, 2003
Posts: 32



(Msg. 2) Posted: Sat May 22, 2004 6:19 pm
Post subject: Re: Accessing VFP 8 tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In news: 4010AD52-2884-4F90-8DB0-CA1A97C3A727 DeleteThis @microsoft.com,
RichG <anonymous DeleteThis @discussions.microsoft.com> wrote:
 > I posted this in the VFP area but I think it may be more for this
 > area. How do you access Visual FoxPro 8 files in VB 5 or 6. The ODBC
 > drivers do not seem to work so I downloaded a new vfpoledb.dll file.
 > It did not help. It seems I need to use OLE DB but I've never used
 > it before. So before I get on the learning curve for something that
 > may not work, can anyone point me in the right direction?

Hi Rich,

You can access VFP files via ADO and OLE DB the same way you'd use those
techniques to access any other files. Here's an example that accesses table
TestTable1, belonging to Test.dbc.

Sub Main()
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset

con.ConnectionString = _
"Data Source=""C:\MY DOCUMENTS\VISUAL FOXPRO
PROJECTS\TEST.DBC"";" & _
"Provider=""VFPOLEDB.1"";"
con.CursorLocation = adUseClient
con.Mode = adModeRead
con.Open

Set rst = con.Execute("SELECT TestTable1.Field1, " & _
"TestTable1.Field2 From TestTable1")
rst.MoveFirst
MsgBox (rst.Fields("Field2").Value) ' "One"

End Sub


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden DeleteThis @mvps.org <a style='text-decoration: underline;' href="http://www.cindywinegarden.com" target="_blank">www.cindywinegarden.com</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Accessing VFP 8 tables 
Back to top
Login to vote
Utf-8BUmljaEc

External


Since: May 21, 2004
Posts: 8



(Msg. 3) Posted: Sun May 23, 2004 10:41 pm
Post subject: Re: Accessing VFP 8 tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you Cindy, your example worked great.
I didn't want to have to buy VFP just to get
to this data set.
Will this work for an individual table that's
not related to a DBC backlink? This group
of DBF's has a couple of tables that do
not show the DBC in the header. They
may be unused tables but I won't know
untill I get into the conversion.
 >> Stay informed about: Accessing VFP 8 tables 
Back to top
Login to vote
Cindy Winegarden

External


Since: Oct 02, 2003
Posts: 32



(Msg. 4) Posted: Mon May 24, 2004 7:24 am
Post subject: Re: Accessing VFP 8 tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In news: 05E839AE-C210-4360-A642-160E8E14FD88 RemoveThis @microsoft.com,
RichG <anonymous RemoveThis @discussions.microsoft.com> wrote:
 > Thank you Cindy, your example worked great.
 > I didn't want to have to buy VFP just to get
 > to this data set.
 > Will this work for an individual table that's
 > not related to a DBC backlink? This group
 > of DBF's has a couple of tables that do
 > not show the DBC in the header. They
 > may be unused tables but I won't know
 > untill I get into the conversion.

Hi Rich,

When a table isn't related to a "Database Container" it's called a "free"
table. To access a free table directory you use only the path to the
directory in the connection string. Something like:

"Data Source=""C:\MY DOCUMENTS\VISUAL FOXPRO
PROJECTS\"";Provider=""VFPOLEDB.1"";"

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden RemoveThis @mvps.org <a style='text-decoration: underline;' href="http://www.cindywinegarden.com" target="_blank">www.cindywinegarden.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Accessing VFP 8 tables 
Back to top
Login to vote
Utf-8BUmljaEc

External


Since: May 21, 2004
Posts: 8



(Msg. 5) Posted: Mon May 24, 2004 10:31 am
Post subject: Re: Accessing VFP 8 tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think I understand.
That should cover all the bases.
Thank you!
Rich
 >> Stay informed about: Accessing VFP 8 tables 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all

Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to understand. I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes....

Scroll Bars - Is there a way to find the size of scrollbars on a system using Visual Basic 6.0? I know how to look and change them on the display properties, but I don't know how to access that information from within Visual Basic.
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]