Using a Select Query to build a MDB table from a Fox table
From: RichG (anonymous_at_discussions.microsoft.com)
Date: 05/27/04
- Next message: Scott: "Memo Fields as Programs?"
- Previous message: Eric den Doop: "Re: How do I refer method on calling form?"
- Next in thread: Eric den Doop: "Re: Using a Select Query to build a MDB table from a Fox table"
- Reply: Eric den Doop: "Re: Using a Select Query to build a MDB table from a Fox table"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 May 2004 12:46:02 -0700
I posted this message a couple of days ago on the VB forum, but no one has responded. Maybe they don't know
how to deal with a version 7 or 8 DBF??????
My ADO knowledge is limited and I'm not sure how a DBF table responds compared to an MDB table.
I can do this easily in DAO using a Jet MDB.
I was able to open a DBF in ADO with the following results
'Open the connection..................................
con.ConnectionString = _
"Data Source=" & dbfPath & ";" & _
"Provider=""VFPOLEDB.1"";"
con.CursorLocation = adUseClient
con.Mode = adModeRead
con.Open
'Get the names of the dbf's one at a time...................
dbfName = Dir(dbfPath & "\*.dbf")
While Not Len(dbfName) = 0
'Strip off the .DBF from the name...........
dbfName = Left(dbfName, InStr(dbfName, ".") - 1)
'Open the BDF in a recordset.....................
'This works..................I can read a field name and value
Set rst = con.Execute("SELECT * From " & dbfName)
If Not rst.BOF Then
'I would like to replicate the dbf in an MDB with the following but I get a syntax error.
con.Execute ("SELECT " & dbfName & ".* INTO " & dbfName & " " & _
"IN 'C:\TEMP\Temp\AccuPrint\vfl.mdb' " & _
"From " & dbfName & "")
This is a common SQL syntax but it fails here
It is a runtime error.
The error says it comes from Microsoft OLE DB Provider for Visual FoxPro.
Error Number -214721900
Even if I substitute a literal name for the variable it doesn't want
to work. Is this not a valid statement in ADO?
Thanks
Rich
- Next message: Scott: "Memo Fields as Programs?"
- Previous message: Eric den Doop: "Re: How do I refer method on calling form?"
- Next in thread: Eric den Doop: "Re: Using a Select Query to build a MDB table from a Fox table"
- Reply: Eric den Doop: "Re: Using a Select Query to build a MDB table from a Fox table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|