Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO connection to Database on Other Network Drives

Status
Not open for further replies.

Iliemoo

Programmer
Sep 25, 2002
64
CA
Hi all, I've been trying to create an ADO connection to my Visual FoxPro databases on several network drives on my ASP pages but always end up with the following message when I try to query to the through the connection.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[Microsoft][ODBC Visual FoxPro Driver]File 'dbtablename.dbf' does not exist.

I am positive the dbf is there. The connection string I¡¦ve used is this.
set cn = Server.CreateObject("ADODB.Connection")
connstr = "Driver={Microsoft Visual FoxPro Driver};
SourceDB=\\networkcomputername\foldername;SourceType=DBF;"
cn.Open connstr
set rs = cn.Execute ( "SELECT * FROM dbtablename" )

Which works fine when the SourceDB is set to a local drive (C:/somefoler). I am using IIS 5.0 on Windows 2000 Pro. I also tried to set the SourceDB to something like I:/foldername where I is the local mapped drive name. What am I doing wrong?
Thank you for your time.
 
Have you tried using a DSN?
(ControlPanel->ODBC Datasources) This is not a bug - it's an undocumented feature...
;-)
 
If I use DSN, how do I set it up and what sorts of connection code would be appropriate?
 
I setup the connection using the same format as described in the web page, but it only works when teh datasource is local, that is on my C drive.
 
I setup the connection using the same format as described in the web page, but it only works when the datasource is local, that is, on my C drive.
 
Do you(the IIS Server) have rights to the folder with the database?

Are you getting an error message?

Kris
 
I am not getting any error message pertaining to access rights to the folders but something like:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[Microsoft][ODBC Visual FoxPro Driver]File 'dbtablename.dbf' does not exist.
One more thing that I've noticed is that I am having trouble setting up virtual directories for those folders on the network as well.
If in deed it is a "rights" issue, where should I look into to fix it? Thanks.
 
I do not know where to look. I am still learning Network Admin stuff (They don't let us programmers fiddle with the network very much).

I am postive someone else in the forum knows where to look.

Kris
 
After talking to the network administrator, in deed it was a rights problem! Thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top