|
-
Jun 25th, 2008, 04:43 AM
#1
Thread Starter
New Member
Access Foxpro data
Hi, I want to retrieve the data from foxpro tables... i already download foxpro driver and installed... i have problem in record sets.. if anyone know post ur comments with examples...
-
Jun 25th, 2008, 06:20 AM
#2
Re: Access Foxpro data
Moved to Database Development
You need to be more specific. What does "i have problem in record sets" mean? Are you getting errors? If so, what? What code are you running that isn't working for you and what, exactly, is happening when you run it?
Are you connecting to your database without any issue?
-
Jun 25th, 2008, 07:19 AM
#3
Thread Starter
New Member
Re: Access Foxpro data
This is the connection string coding:
con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & App.Path & "\;Exclusive=No;"
I searched google, all of them explained only about connection string..
How to access the table in foxpro? Generally foxpro contains only tables.. maybe it doesn't... i work with dbf file for 1st time....
rs.Open "select * from auay04", con, adOpenDynamic, adLockOptimistic
error: odbc doesnot support this proprty..
-
Jun 25th, 2008, 07:21 AM
#4
Thread Starter
New Member
Re: Access Foxpro data
correction:
con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & App.Path & "\test.dbf;Exclusive=No;"
-
Jun 25th, 2008, 07:33 AM
#5
Re: Access Foxpro data
Ok, I'm still a bit confused.
Are you successfully connecting to the database, or is the connection the real issue?
(Because, if you can't connect properly, there is no way you are going to retrieve anything.)
-
Jun 25th, 2008, 11:16 PM
#6
Thread Starter
New Member
Re: Access Foxpro data
Connection doesn't show any errors... dbf is a single file or table.. for eg: in access database contains any no of tables.. but in dbf each file is a table.. my problem r as follows,
1. how to connect
2. open tables
-
Jun 26th, 2008, 08:56 AM
#7
Addicted Member
Re: Access Foxpro data
Wow, sounds like my environment, to some degree. Can you post up a couple of file names or the files themselves? Ever play around with dynamic data sources?
Something like the following. (Exact VB syntax to be added by you.)
Code:
Option Explicit
Private Sub MyVFPDBProc()
Dim strFileName As String
Const strMY_PATH As String = "C:\TEMP\"
strFileName = Dir(strMY_PATH & "*.dbf", vbNormal)
Do While Len(strFileName) > 0
con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" _
& strMY_PATH & strFileName & "\;Exclusive=No;"
'Do work on your connection
'.
'.
' Finish work, close connection
strFileName = Dir
Loop
End Sub
[Edit for readability]
Last edited by Darren M.; Jun 26th, 2008 at 09:08 AM.
-
Jun 26th, 2008, 11:56 PM
#8
Thread Starter
New Member
Re: Access Foxpro data
i finished it using visual foxpro oledb driver.. now its working...during the connection we should not mention the file name, only path..
sample:
con.Open "Provider=VFPOLEDB.1;Data Source=" & f & ";Password=;Collating Sequence=MACHINE"
rs.Open "select * from " & tb, con, adOpenDynamic, adLockOptimistic
f-contains the path
tb-contains file name
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|