Re: Create DSN-Less link to Foxpro table in Access
- From: "Fred Taylor" <ftaylor@xxxxxxxx!REMOVE>
- Date: Sat, 2 Dec 2006 10:47:37 -0700
www.connectionstrings.com
Look under the DataFiles section and ther they have Visual FoxPro for both
the DBC and free tables strings.
--
Fred
Microsoft Visual FoxPro MVP
"Kevin" <Kevin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C2E3D816-AE47-4C89-9E19-DC4F8288C4FB@xxxxxxxxxxxxxxxx
I posted this in the access.exteranldata forum but thought I would put it
here as well hoping that Foxpro users might have the answer. I'm trying
to
create
a dsn-less connection to a Foxpro table (through the dbc). The following
code
works great only it requires the DSN FPadmin to be setup. How would I
modify
this so that the DSN is not required on the user's computer?
Public Sub DSNFP()
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim ConnectString As String
Set db = CurrentDb
ConnectString =
"ODBC;DSN=FPadmin;SourceDB=E:\admin.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;"
Set td = db.CreateTableDef("personne")
td.Connect = ConnectString
td.SourceTableName = "personne"
db.TableDefs.Append td
'Following code is required because no primary key is defined on personne.
'Without the following code, personne is read only.
Dim strSQL As String
strSQL = "CREATE INDEX pk_emp_no ON personne(emp_no) WITH PRIMARY"
Set dbs = DBEngine(0)(0)
dbs.Execute strSQL, dbFailOnError
End Sub
I have tried changing up the connection string to something like the
following.
ConnectString = "ODBC;Driver=Microsoft Visual FoxPro
Driver;SourceType=DBC;SourceDB=E:\admin.dbc;Exclusive=No"
But then I get an error -
Run-time error '3000';
Reserved error (-7778); there is no message for this error
That took me to this article http://support.microsoft.com/kb/285345/en-us
But that shows opening the database. I want to create a link to the
table.
Can
anyone offer a solution? I started out using DAO but if this can be done
some other way, through ADO for example, that's fine.
Thanks,
Kevin
.
- Next by Date: Re: Create DSN-Less link to Foxpro table in Access
- Next by thread: Re: Create DSN-Less link to Foxpro table in Access
- Index(es):
Relevant Pages
|