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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error

Status
Not open for further replies.

Josh6273

Programmer
Nov 13, 2001
17
0
0
US
Hi all -

I am having some trouble accessing a Crystal Report through my application using the BDE accessing a Paradox database, and I am thoroughly confused as to why this might be happening. When I run the report from within Crystal, it works fine, but when I run it through my BCB5 application, I get the following error in my ODBC trace:

szSQLState: "S1000"
szErrorMessage: "[Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you n eed permission to view its data."
NativeErrorCode: -1032

My hunch is that this is somehow related to a strangeness in the BDE because I was able to get this working for a period last week. I found that there were a couple of fields in one of my tables that were not defined in my application, so I added them to the database definition, rebuilt/re-ran the application and ran the report. It worked just fine. So, I opened up Database Desktop to go through each of my tables to ensure that all of the fields were defined, and I then started getting corrupted index errors on all of my tables. After wasting alot of time trying to resolve that issue, I decided to reboot the machine. After the reboot, I could then access the tables, but the inital report problem returned. I'm stumped. Does anyone have any clue what might be happening here?

Thanks,
Josh
 
BCB5 ? (do you mean borland c builder5)

what version paradox are you using ?
what version of crystal are you running
what odbc driver are you using ?
 
Sorry. Here's the details:
*Paradox 5 runtime (I have no choice in this...bah)
*Crystal Reports Developer 8.5.
*Microsoft Paradox driver 4.00.5303.01
 
i don't know much about paradox 5 (was it 'paradox for windows' or the last dos derivative). Eitherway your error message sounds like one you get in the later paradoxs, which is to do with setting the net directory property in the odbc driver.

When you have set the net director in the driver setup have you used mapped drives or abosolute references. the paradox driver works quick with mapped drives but i more liable to fail.

which bde are you using ?

sorry for all the questions.......

 
Hi - No worries on the questions. I don't mind giving any answers that I can to help clear this up!

I have set the Net directory in the ODBC configuration to be the same as it is in the BDE: C:\shb30\data

Also, I am using 5.11 of the BDE and version 5 of Paradox for Windows. Additionally, I am running Windows 2000 SP1.

Thanks for your help!
Josh
 
i am not sure for pdox 5 but with the later versions of paradox you can connect natively with the bde without odbc. If you are using BDE5.11 (latest version) then paradox version should be irrelavent. This has advantage of speed (beacuase it can see index's etc) and less odbc gremlins.

now you can use odbc but this is easier. If you set up a test report in crystal reports.

file
new
blank report
(in data explorer)
database files (under odbc)
find databse file
(lets say) db1.db


bang you in with a native connection as if you were looking at if from paradow itself.

I am actually a crystal person. My company use a marina management system written in delpi/paradox. Very few people seem to know about the native connection, (even the crstal experts) but it can revoutionise your dataflow.

My knowlegde of paradox also resides in the later versions. As i understood the net directory contains files that control the locking of files between users and where the db is? so i'm suprsied its on your c drive. But this is an area i'm not so sure of. If you are sure and know that the net directory is set up ok then OK. ( the only reason i bang on about the net dirctory is that you get a simalar error when you don't set a net direcotory and connect through odbc)

i would try the native connection works, tel me if it works......
 
Wow, an interesting thread. Various responses follow:

1. Not completely versed in CPPB, but I do know Delphi pretty well and I suspect things are very similar. Corrupted index errors usually suggest either a) configuration is screwy or b) you're not explicitly closing tables.

Start by making your your client application is specifically closing the TTables (TBDEDataset, whatever) you're using to access your Paradox tables.

2. Microsoft's ODBC driver for Paradox is useable, but has a reputation for being finicky. You might consider using Intersolv's ODBC driver for Paradox instead.

It's provided with recent versions of Paradox, though I don't believe that includes redistribution. I'd check the licensing if you intend to provide the application out of the office.

3. Paradox 5.0 was indeed Paradox for Windows (16-bit). Version 5 of Paradox/DOS never shipped; it's last release was 4.5.

4. It's possible that your tables are damaged and need to be repaired. Look for a Table Repair command on Database Desktop's Tools | Utility menu. There's an option for verifying your tables. Run that on each table and see if it needs to be repaired.

Note: You'll need to recreate your indexes on any tables that need to be repaired.

Hope this helps...

-- Lance



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top