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

Cannot connect to ODBC data source

Status
Not open for further replies.

TonyG

Programmer
Nov 6, 2000
79
US
Hello.

I'm trying to connect to a newly created Pervasive ODBC Engine Interface Data Source(called CPDATA) in Visual Studio.Net 2003.

In the Data Link Properties dialog,

On the Provider tab, I choose "Pervasive SQL V8 OLE DB Provider"

On the Connection tab, I enter Data Source=CPDATA, Location=localhost and click the Test Connection button

I get the message "Test connection failed because of an error in initializing provider. -4987: The MicroKernel cannot find the specified file".

If i change the Data Source to PVideoDB, it connects OK.

I have all of the latest Pervasive software, patches, updates, etc.

Windows XP SP2, Database Service Manager for Workgroup Engine 8.50.189.000

Any help would be greatly appreciated.

Thanks,
Tony
 
Can you use this data source somewhere else, such as MS Access or Crystal Reports?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
The fact that it connects to PVideoDB, means that Pervasive is working. Is CPDATA the DSN name or the Database Name (as seen in Maintain Named Databases in the PCC)?
If it's just the DSN name, then you need to specify the DB Name.
You might also run a Database Consistency check to make sure that all of the files are valid.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
I can use the data in PCC, SQL Data Manager, MS Access, COBOL.

The DSN and DB name are the same.

I ran the Database consistency check and all of the files failed except the $files.

So it sounds like i have some other problem. I can't imagine what it could be if i can see the data from all those other sources.

Thanks,
Tony
 
What were the failures? I'm shocked that one interface fails while all the others are working.
Have you considered the either the Managed Provider or ODBC rather than OLEDB?

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
The failures just said "Failed" under the results column for all files except the "X$" files. Only one "X$" file failed, the "X$View" file failed.

How do i use Managed Provider or ODBC instead of OLEDB ?

Thanks,
Tony
 
You actually have to go to the screen past the results to see what the failures are. The screen will have a printer and diskette icon. Clicking the diskette icon will allow you to save the report.
The fact that there are failures could explain why OLEDB doesn't work.

To use the Managed Provider or ODBC, you would need to add the appropriate reference (Pervasive.Data.SqlClient or System.Data.Odbc). The Managed Provider is a separate DOwnload from the Pervasive DeveloperZone.
You would then use the xxxConnection and xxxCommand (just like OLEDB but xxxx would be "Odbc" or "Psql"). There's samples in the ".NET" section of the DeveloperZone.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Mirtheil,

Here is the first part of the log that i saved.

===============================================
Database consistency test results.
Test was run on: Friday, April 22, 2005 12:48:30 PM

DSN: CPDATA

Database name: CPDATA

Database Location: \\COMPEXSERVER\SYN\CP758\DEMO2
===============================================


===============================================
Database Check Statistics
===============================================
Pervasive.SQL Compatibility Mode = 8
Tables Checked = 85
Tables Passed = 3
Tables Failed = 82

Illegal Object Names = 5
Record Length Inconsistencies = 8
Variable Length Column Inconsistencies = 0
Data Type Inconsistencies = 0
Column Overlaps = 0
Full Path (instead of Relative) Table Locations = 0
Table Files Don't Exist = 0
Index Inconsistencies = 829
System Table Inconsistencies = 0
General Dictionary Inconsistencies = 2


===============================================
Tables That Passed Test
===============================================
X$Field
X$File
X$Index


===============================================
===============================================
Problems Detected with Database Definitions
===============================================
+++++++++++++++++++++++++++++++++++++++++++++++
Table Name = Accounts

Index Seg Flag Inconsistency.
The dictionary index 0 seg 0 indicates Yes
Data file index 0 seg 0 indicates No
Index Length Inconsistency.
The dictionary index 0 seg 0 indicates 8 (Column = 'MainAccount')
The data file index 0 seg 0 indicates 16
Dictionary Index Not Defined in Data File.
Dictionary defines index 0 seg 1
The data file does not.
Index Seg Flag Inconsistency.
The dictionary index 1 seg 1 indicates Yes
Data file index 1 seg 1 indicates No
Index Length Inconsistency.
The dictionary index 1 seg 1 indicates 8 (Column = 'MainAccount')
The data file index 1 seg 1 indicates 16
Dictionary Index Not Defined in Data File.
Dictionary defines index 1 seg 2
The data file does not.
Index Seg Flag Inconsistency.
The dictionary index 2 seg 1 indicates Yes
Data file index 2 seg 1 indicates No
Index Length Inconsistency.
The dictionary index 2 seg 1 indicates 8 (Column = 'MainAccount')
The data file index 2 seg 1 indicates 16
Dictionary Index Not Defined in Data File.
Dictionary defines index 2 seg 2
The data file does not.
Index Seg Flag Inconsistency.
The dictionary index 3 seg 1 indicates Yes
Data file index 3 seg 1 indicates No
Index Length Inconsistency.
The dictionary index 3 seg 1 indicates 8 (Column = 'MainAccount')
The data file index 3 seg 1 indicates 16
Dictionary Index Not Defined in Data File.
Dictionary defines index 3 seg 2
The data file does not.
+++++++++++++++++++++++++++++++++++++++++++++++
 
The index inconsistencies shouldn't cause the behavior you are seeing. THey will cause performance problems though. The bigger problems are the "Record Length Inconsistencies" and the "General Dictionary Inconsistencies". Those are the ones to look at.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top