Results 1 to 5 of 5

Thread: OLE DB problem

  1. #1
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    45

    Unanswered: 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:
    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

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    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.

  3. #3
    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.

    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

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    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.

  5. #5
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •