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 > Database Server Software > Pervasive.SQL > OLE DB problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-22-03, 06:38
Rawbat Rawbat is offline
Registered User
 
Join Date: Oct 2003
Location: Sweden
Posts: 45
OLE DB problem

I have problem deploying a solution using OLE DB to connect to Pervasive 2000i databases.
The solution works fine on the Pervasive v8 installation I got, but on the client to the 2000i I get:
Quote:
Connection failed because of an error in initializing provider.
I could rewrite to use ODBC, but would prefer to use OLE DB if possible so I do not have to create local DSNs for every database.

Or are dsn-less odbc connections possible?

Thanks,
Robert
Reply With Quote
  #2 (permalink)  
Old 10-22-03, 09:53
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Are you intalling the OLEDB provider? What version of Pervasive.SQL are you using? For Pervasive.SQL 2000i, it was W3DADBV2.DLL and W3DAERV2.DLL that make up the OLEDB provider. WIth Pervasive.SQL V8, it's POLEDB.DLL, POLEDER.DLL, and POLEDBSY.DLL. Make sure you've got the files installed and registered for your version.

You can use DSN-Less connections with ODBC. The version of the engine and whether you are using a CLient or Engine DSN will determine what the connection string looks like.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 10-22-03, 10:02
Rawbat Rawbat is offline
Registered User
 
Join Date: Oct 2003
Location: Sweden
Posts: 45
Thanks,
I do have those files (W3DADBV2.DLL and W3DAERV2.DLL) for the OLE DB provider on both the client and the server but I get the error message I mentioned in my original post.

Quote:
Originally posted by mirtheil
You can use DSN-Less connections with ODBC. The version of the engine and whether you are using a CLient or Engine DSN will determine what the connection string looks like.
I use version 2000i and would prefer to not have to create client DSNs.
Can you post an example of a DSN-less ODBC connection?

It's not a lot of extra work creating the ODBC sources for now, but it would be nice to know how it's done for the future.

Cheers,
Robert
Reply With Quote
  #4 (permalink)  
Old 10-22-03, 12:39
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Are those files registered using regsvr32? If not, that's probably your problem.
From Pervasive's KB (solution id psql552):
SQL Connection String parameters have changed significantly between Pervasive.SQL 7.0 and Pervasive.SQL 2000. Here are the connection string parameters supported by Pervasive.SQL 2000.

Driver={Pervasive ODBC Client Interface}
The "Pervasive ODBC Engine Interface" driver does not permit connection through SQLDriverConnect (DSN-less connection).

For Client Interface DSNs, use the following parameters:

ServerName= <servername where Engine DSN resides>
*if using on a non-default TCP port, the server name should be followed
by a period and the TCP port, ie. <servername>.1583
ServerDSN= <May be either an Engine DSN on the server, or a DBNAME>
TransportHint= <TransportHint may be one of the following values:
TCPPX = Tries TCP/IP first, then SPX
SPX:TCP = Tries SPX first, then TCP/IP
TCP = Tries only TCP/IP
SPX = Tries only SPX>

Optional additions based on settings:
TCPPort= <TCP Port server is listening on,default is 1583>
ArrayFetchOn= <1(one) for On, 0(zero) for Off>
ArrayBufferSize= <size of buffer in KB, default is 8KB>
UID= <Username>(required if security is enabled)
PWD= <password> (required if security is enabled)

Example:

Driver={Pervasive ODBC Client Interface};ServerName=ServerMain;DBQ=DEMODATA;

To establish a connection to a Pervasive.SQL 2000 server database,
Use the Pervasive ODBC Client Interface:
1. Call SQLAllocHandle with SQL_HANDLE_ENV as the handle type, to
allocate the environment handle.
2. Call SQLAllocHandle with SQL_HANDLE_DBC to allocate a connection handle. 3. Call SQLDriverConnect with the appropriate connection string. If you
are using a minimum set of connect string parameters, use
SQL_DRIVER_COMPLETE for the completion parameter.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #5 (permalink)  
Old 10-22-03, 12:54
Rawbat Rawbat is offline
Registered User
 
Join Date: Oct 2003
Location: Sweden
Posts: 45
Smile

Thank you very much for the detailed answer!

I'll try to register the files if installation failed to do so properly... may also copy the files from the server, saw in some note on SP4 that it might be an issue.

Will try the ODBC-thing if the registering doesn't work.

I've mainly worked with MS SQL Server before and got a little confused in the beginning with DSNs on server and DSN in ODBC... got it running now though.

Cheers,
Robert
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