If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > DBF file does not exist!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-03, 16:56
digitalalias digitalalias is offline
Registered User
 
Join Date: Oct 2003
Location: Hollywood, FL USA
Posts: 4
Exclamation DBF file does not exist!

Hi Gang,

I'm using WinXP Pro with IIS. I'm using a .dbf file from a foxpro database. All I have to work from is this dbf file. I finally got it connected (rigerous search) using a file dsn. Now I'm getting a "does not exist" error when I query this file. Here is my code:

<%

Set objConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")

'objConn.Mode = 3
strConnString = "filedsn=" & Server.MapPath("database/php_prov.dbf.dsn") & "; DBQ=" & Server.MapPath("database/php_prov.dbf")
objConn.Open strConnString

query="select * from php_prov.dbf"
Set RS = objConn.Execute(query)

response.Write RS("firstname")

%>

The error I get is this:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[Microsoft][ODBC Visual FoxPro Driver]File 'php_prov.dbf' does not exist.
/flmedpro/test.asp, line 21


Can anyone help me!?! Thanks.
Reply With Quote
  #2 (permalink)  
Old 10-28-03, 08:35
vextout vextout is offline
Registered User
 
Join Date: Jan 2003
Location: New York
Posts: 160
make sure the full path to the dbf has no spaces and the length of the path is less than 128 chars
__________________
Beyond Limitation
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 10:31
Dark13wolf Dark13wolf is offline
Registered User
 
Join Date: Feb 2004
Location: Cooperstown, ND
Posts: 5
Cool Try this it worked for me

Here is the DSN-less connection string I used:

Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "Driver={Microsoft Visual FoxPro Driver};" &_
"SourceType=DBF;" &_
"SourceDB=\\Ndctf001\DATA\impact\TIME;" &_
"Exclusive=No;" &_
"BackgroundFetch=No"

The last entry was the key for me.
Reply With Quote
  #4 (permalink)  
Old 02-12-04, 11:17
digitalalias digitalalias is offline
Registered User
 
Join Date: Oct 2003
Location: Hollywood, FL USA
Posts: 4
Thumbs up

Hi Dark13,

Thanks for your response. I actually switched to PHP. I no longer use ASP. It was a silly reason, but I'm glad I made the switch. Because I had such a hard time with the connection string and the project needed to be done immediately - I found a much easier connection string with PHP
PHP Code:
mysql_connect("localhost","username","password");
mysql_select_db("database_name"); 
That's it! Simply two lines of code, which I can memorize and understand what it means. So thanks again, but I'm a PHP user now!
Reply With Quote
  #5 (permalink)  
Old 02-12-04, 11:20
Dark13wolf Dark13wolf is offline
Registered User
 
Join Date: Feb 2004
Location: Cooperstown, ND
Posts: 5
OOPS

Well, at least I tried
Reply With Quote
  #6 (permalink)  
Old 02-12-04, 15:57
Dark13wolf Dark13wolf is offline
Registered User
 
Join Date: Feb 2004
Location: Cooperstown, ND
Posts: 5
Question OK perhaps PHP is the way to go...how?

OK my code worked for about 3 hours now nothing...if I give you what I have could you put it in PHP so I can at least start to learn it?

<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "Driver={Microsoft Visual FoxPro Driver};" &_
"SourceType=DBF;" &_
"SourceDB=\\Ndctf001\DATA\impact\TIME;" &_
"Exclusive=No;" &_
"BackgroundFetch=No"
%>

<%
SQL_query = "SELECT * FROM EMPFILE"
Set RS = MyConn.Execute(SQL_query)
%>

<%
While not RS.EOF
%>

<LI><%=RS("efname")%> <%=RS("elname")%><BR>
PHONE: <%=RS("phone")%><BR><BR>
<%
RS.MoveNext
WEND
%><%
RS.Close
MyConn.Close
%>

Or if you know what happened? I didn't touch the code, I walked away and now it refuses to work.
Reply With Quote
  #7 (permalink)  
Old 02-12-04, 17:12
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
where you have
Code:
query="select * from php_prov.dbf"
Set RS = objConn.Execute(query)
you should have something like,
Code:
query="select * from tablename"
Set RS = objConn.Execute(query)
You are currently referencing the whole database file instead of a specific table within the database.
Reply With Quote
  #8 (permalink)  
Old 02-12-04, 17:18
Dark13wolf Dark13wolf is offline
Registered User
 
Join Date: Feb 2004
Location: Cooperstown, ND
Posts: 5
Quote:
Originally posted by rokslide
where you have
Code:
query="select * from php_prov.dbf"
Set RS = objConn.Execute(query)
you should have something like,
Code:
query="select * from tablename"
Set RS = objConn.Execute(query)
You are currently referencing the whole database file instead of a specific table within the database.
OK, but this is DOS FoxPro I'm trying to attach to, you don't use a table name since the table name is the filename. Other than that I don't see a difference.
Reply With Quote
  #9 (permalink)  
Old 02-12-04, 17:22
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
OOPS

Well, at least I tried
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On