Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003

    Question Unanswered: ODBC Connection to Pervasive.sql2000i

    Hello I'm trying to create a ODBC connection programmatically to Perasive.sql from a module in Access. I know I need to create a system DSN. I have no problem creating a User DSN but pervasive.sql needs to have a system DSN. I can make a system DSN if I make an one with an Access driver, for some reason I can't find anything to help me with coding a Pervasive ODBC Engine Interface driver.


  2. #2
    Join Date
    Feb 2004
    - What language are you writing in?
    - How are you creating the ODBC's now?
    - Are you able to create a system DSN at all, or are you only having trouble creating Pervasive system DSN's?

    EDIT: Try creating one manually and then go see what keys/values were added to the registry.

    Last edited by Dilyias; 08-30-04 at 14:45.

  3. #3
    Join Date
    Nov 2003
    I'm writing in VB
    I was creating the System DSN's through the ODBC Data Source Administrator

    I have code that will create an access DSN i just can't get it to work with the Pervasive ODBC Engine Interface

    Here is the code I have now.

    Option Compare Database

    Option Explicit
    Const ODBC_ADD_SYS_DSN = 4 'Add data source

    Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal _
    hwndParent As Long, ByVal fRequest As Long, ByVal _
    lpszDriver As String, ByVal lpszAttributes As String) As Long

    Function Build_SystemDSN()

    Dim ret%, Driver$, Attributes$
    Dim DSN_NAME As String
    Dim Db_Path As String
    Dim DB_Name As String

    DSN_NAME = "TestA"
    DB_Name = "test"
    Db_Path = "C:\"

    'Driver = "Microsoft Access Driver (*.mdb)" & Chr(0)
    Driver = "Pervasive ODBC Engine Interface" & Chr(0)
    Attributes = "DSN=" & DSN_NAME & Chr(0)
    Attributes = Attributes & "Uid=" & Chr(0) & "pwd=" & Chr(0)
    Attributes = Attributes & "DBQ=" & DB_Name & Chr(0)
    ' Attributes = Attributes & "OPENMODE=0" & Chr(0)
    ' Attributes = Attributes & "DDFPATH=" & Db_Path & Chr(0)

    ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, Driver, Attributes)

    ' ret is equal to 1 on success and 0 if there is an error
    If ret <> 1 Then
    MsgBox "DSN Creation Failed"
    End If

    End Function

    I can get it to create the Access system DSN but not the pervasive System DSN. I went to the pervasive site and it said the Engine interface only needed the Driver, DSN, UID, and PWD.

    I'm trying to connect to DDF files that are from MPM 3.0. I was going to try and use Pervasive.slq V8 it has ole db capabilities, but the people at Business Engine said I cannot use the Pervasive.slq V8 it will not work with the current version of MPM.


  4. #4
    Join Date
    Feb 2004
    Are you running everything on the same server? The engine interface will only work if run on the same server where pervasive is running. And at that point there should already be an ODBC defined for that database so you don't need to specify it programmatically.

    You should use the client odbc if you are running access on a box different than the database server, and must also specify the SERVER as well as the database.

Posting Permissions

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