Link to home
Start Free TrialLog in
Avatar of CJ_S
CJ_SFlag for Netherlands

asked on

DBase connection problem

Posting this question for a colleague (and I don't know the answer either).

-------------------------------

When trying to connect to a DSN DBase (dbf) file i get the following error:
 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[Microsoft][ODBC dBase Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
I have tried on another machine with the same exact DSN configuration and there was no error so i assume it is not the coding.
My connection is very simple:
 
---------------------------------------------------------------------------------
Set objDB=Server.CreateObject("ADODB.Connection")
objDB.Open("DSN=SUPERSITE;Uid=;Pwd=;")

---------------------------------------------------------------------------------
 
When using this code on my workstation, where i created the "SUPERSITE" DSN pointing to a local DBF database, it works fine.
When using this code on the server, where i have the "SUPERSITE" DSN with the same configuration as my workstation, also pointing to a local DBF database, it gives the error.
 
The server is running Windows 2000 Advanced Server, the Workstation is running Windows 2000 Professional.
Maybe it is a file system permission problem?
 
I already spent many hours trying to solve this but without success so i hope someone can help me. :-)
Avatar of markhoy
markhoy
Flag of United Kingdom of Great Britain and Northern Ireland image

the path is wrong in the dsn. Try using a DSNLess connection and it will make your code portable:

use myDb = server.mapPath("my.dbf") if required.


http://www.able-consulting.com/ADO_Conn.htm

oConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
           "DriverID=277;" & _
           "Dbq=c:\somepath"
Then specify the filename in the SQL statement:

oRs.Open "Select * From user.dbf", oConn, , ,adCmdText
Avatar of CJ_S

ASKER

It's a DBVase V file, not DBase IV
Avatar of CJ_S

ASKER

When using a DSNless connection (which i had already tried) i get the following error:
 
 Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC dBase Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x468 Thread 0x6bc DBC 0x23917fc Xbase'.

The driver ID is also NOT 277. DriverID 277 is for DBase 4, this is a DBase 5 file...:-) And yes i already tried the right DriverID, gives the same error.
So either DSNless or DSN, none works...but on my workstation it works fine. :-) I still think its something to do with file system permissions...but nothing seems to make any difference...anyone had this prob before?

ASKER CERTIFIED SOLUTION
Avatar of Programming_Gal
Programming_Gal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CJ_S

ASKER

Some times it is the easy solution!!! Thanks Gal! ;-)