Solved

trouble with .dbf file

Posted on 2004-04-30
7
2,849 Views
Last Modified: 2013-11-24
I'm trying to open a dbf file through ASP and it gives me this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC dBase Driver] External table is not in the expected format.

If I right click the file in Explorer, then choose Open With, then MS Access, it gives me this error:

Unrecognized Database Format 'D:\myfile.dbf'.

If I go into Access, then click File->Open and select the file, it seems to open it, but then says "External table is not in the expected format".

However, I can open the file in MS Excel and view it perfectly.
So, what's up with this file?

I have Windows 2000 Server and MS Office 2000. Thanks in advance.
0
Comment
Question by:vitanza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 10964716
Don't think ASP will access DBase without the right driver...
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10964719
Check here for driver script...not sure.

http://www.able-consulting.com/ADO_Conn.htm
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 10964833
Use either of the two connection strings..

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password="

"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\mydbpath;"

Cheers!!

0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:vitanza
ID: 10965021
When I try the first connection string it gives me the same error:

Error Type:
Microsoft JET Database Engine (0x80004005)
External table is not in the expected format.

When I use the second connection string it says the same:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC dBase Driver] External table is not in the expected format.

==============================================

Here is my code:

Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=D:\;"

dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM MYTABLE", objConn


The error actually does not occur at the connection line - it occurs at the "objRS.Open...." line.
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 10965051
Try this..

Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=D:\;"

If objConn.State=1 then
dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM MYTABLE", objConn,1,3
If not objRS.EOF THen
Response.WRite "Success!!"
End If
Else
Response.write "Connection error"
Response.end
End If

Cheers!!
0
 

Author Comment

by:vitanza
ID: 10965086
If I do that it gives me the same error, but if I put "on error resume next" in front of it, it writes "Success!".
Again, the error occurs at the line "objRS.Open..."

By the way, I have several other pages that are accessing a dbf file in the same directory, but I created a System DSN for them. I tried using a DSN at first for this, but no luck. It could possibly be the file, but I can open it in Excel, so I'm not sure....
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 125 total points
ID: 10965109
Looks like its an issue with memo fields in your dbf files..

Check out this post...

http://www.tek-tips.com/gviewthread.cfm/pid/1252/qid/825675

Cheers!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select case on click 3 31
SharePoint 2013 URL Duplication Issue 5 67
Index on a Table 6 38
StoredProcedure to JSON query faulty syntax 2 45
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question