Pervasive
Sign in | Join | Help
in

Create ODBC DSN

Last post 07-03-2008 1:00 PM by gutonanet. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-13-2008 1:12 AM

    Create ODBC DSN

    Hi 

    Can someone please upload some code on how to create an "Pervasive ODBC Engine interface" DSN.

    I've have done this a long time ago using cobol and win32 api, but have moved on to .NET and I'm not shure which libraries to use

     

    Thanks...

     

     

  • 06-16-2008 10:50 AM In reply to

    Re: Create ODBC DSN

    Nevermind.. I've figured it out
  • 06-24-2008 6:33 PM In reply to

    Re: Create ODBC DSN

    Hi I have the same request.

    I am using Delphi 2007 and PDAC v9. I can create a working DSN that is visible in the Pervasive Control Centre. I would like however to create it as a System DSN - as a server and client DSN.

     

    The pervasive guide( http://www.pervasive.com/support/technical/psqlv9/PSQL_PDAC_Guide.pdf) gives some direction but it does not seem to work.

    Here is the code I am using:

    procedure TfrmCreateNewDSN.Button1Click(Sender: TObject);
    var MyList,SystemDSNList: TStringList;

    begin
        MyList := TStringList.Create;
    try
      with MyList do
      begin
          Clear;
          Add('DDF_PATH= C:\pastel07\');
          Add('PATH=C:\pastel07\testcompany\');
          Add('BOUND=False');
          Add('INTEGRITY=False');
          Add('Create_DDF=False');
      end;
      dm.PvSession1.AddAlias('testcompany', MyList);
    finally
     MyList.Free;

    SystemDSNList := TStringList.Create;
    try
      with SystemDSNList Do
      begin
        clear;
        Add('DB_NAME=test');
        Add('IS_ENGINE_DSN=False');
        Add('IS_SYSTEM_DSN=True');
        Add('SERVER_NAME=renier-pc');
        Add('SERVER_DSN=testcompany');//  *** this dsn does not exist and is the  SYSTEM DSN to be created ***
        dm.PvSqlSession1.AddAlias('testclient', SystemDSNList);
      end;
    finally
    SystemDsnList.Free;
    end;

    I get the following error:

    Project Project1.exe raised exception class EPvSqlInstallerEngineError with message 'Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed. Session name is PvSqlSession1_1. Component is PvSqlSession1, owned by DM'.

     Can someone please point me in the right direction?

    Thanks

     

    Renier Nell

  • 06-25-2008 4:10 PM In reply to

    Re: Create ODBC DSN

     

    Please

    add

     

    ('TRANSPORT_HINT =TCP');

     

    as folows

     

    Add('DB_NAME=test');
        Add('IS_ENGINE_DSN=False');
        Add('IS_SYSTEM_DSN=True');
        Add('SERVER_NAME=renier-pc');
        Add('SERVER_DSN=testcompany');//  *** this dsn does not exist and is the  SYSTEM DSN to be created ***
       Add('TRANSPORT_HINT =TCP'); 

     dm.PvSqlSession1.AddAlias('testclient', SystemDSNList);

     

    Thanks, 

    Johnson Varughese

  • 07-03-2008 1:00 PM In reply to

    Re: Create ODBC DSN

    Hi, This source generate erro: EPvDbAdminEngineError with message 'DB names API error 7039. Alias name: testCompany. Session name is PvSession1. Sorry my english, I am from brazilian. Augusto
Page 1 of 1 (5 items)
© 2008 Pervasive Software Inc. All Rights Reserved.