For DBF's the folder is the 'database' name, and the DBF file (no extension) is the table. Spaces
in the path are immaterial and do not affect the usage since the connection string is delimited by
'=' and ';' for parameter and value pairs.
Dim pobjConnection
Dim pobjRS
Dim pstrDatabase
Dim pstrConnectionString
pstrDatabase = "C:\Program Files\MyFolder"
pstrConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & pstrDatabase & ";" & _
"Extended Properties=dBASE IV;" & _
"User ID=Admin;" & _
"Password="
'Open connection to the folder.
Set pobjConnection = CreateObject("ADODB.Connection")
pobjConnection.Open pstrConnectionString
'Get the recordset
Set pobjRS = CreateObject("ADODB.Recordset")
pobjRS.Open "SELECT * FROM DBFNAME", pobjConnection
Hope this helps,
Chris.
"Kaczala" <ghuber.TakeThisOut@poczta.onet.pl> wrote in message news:c95gok$f83$1@opal.icpnet.pl...
Hi
I have i smple problem
I want to perform a query that containst path as table name.
Problem is when the path contains spaces
Example:
SELECT * FROM C:\TEMP\MyDatabase.dbf 'OK
SELECT * FROM C:\Program Files\MyDatabase.dbf 'ERROR (space in table
name)
SELECT * FROM "C:\Program Files\MyDatabase.dbf " 'ERROR
SELECT * FROM 'C:\Program Files\MyDatabase.dbf' 'ERROR
How can I correct this to start working.
Thanks in advice.
Kaczala
>> Stay informed about: Select * from table??!!