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

Accesing Pervasive Tables from MSQL 1

Status
Not open for further replies.

JohnEfford

Programmer
May 24, 2002
108
GB
I need to be able to execute queries that use tables from both Pervasive and Microsoft SQL databases. I have tried connecting to the pervasive database from MSQL using the following:

Select * From openrowset('PervasiveOLEDB','Provider=PervasiveOLEDB;Data Source=Fops;Location=Fops1','Select * From Order_Header') as A

Which returns the error:


Server: Msg 7303, Level 16, State 2, Line 1
Could not initialize data source object of OLE DB provider 'PervasiveOLEDB'.
[OLE/DB provider returned message: Errors occurred]
[OLE/DB provider returned message: Mode, Protection Level, or an unknown parameter has been set (incorrectly) in the connection string

The connection string works fine when used in a Visual Basic program.

Cheers
 
I don't believe you can use the PervasiveOLEDB provider as part of a linked server in MS SQL. You should be able to switch to the ODBC driver and it should work.


info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Could you help us out with an example, please. I have Have setup a DSN on the server and tried to use this as the source I still could not get it to work.
 
You could try:
Select * From openrowset('MSDASQL','Provider=MSDASQL.1;Data Source=Fops','Select * From Order_Header') as A

where the ODBC DSN is named Fops.


info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
mirtheil

Thanks for your input finally got query to work using


Select * From openrowset('MSDASQL','Provider=MSDASQL.1;DSN=FOPS1_DSN','Select * From Order_Header') as A

Thank you
 
Sir
i have betrive database , i have to connect this through vb6.
pls give me code.
& which dsn i have to use.

arun k m
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top