A new utility for the Actian / Pervasive PSQL database engine has been released. This utility, PsqlDbCreate, offers the ability to create PSQL database names using a command line interface on Windows. While dbmaint exists on Linux, there is no equivalent tool on Windows. This tool aims to fill that need.
All the information you might need is available on the PsqlDBCreate page.
PsqlDBCreate can also be downloaded here.
Creating Actian / Pervasive PSQL database using DTO and C#
Recently, a post asked how to create an Actian / Pervasive PSQL database from the command line. PSQL on Linux has the DBMAINT utility but no such utility exists on Windows. I put some code together in C# that will create a database based specified parameters. The DTO Library will need to be added as a COM reference to the project. This is basic code but can be used as a basis for your own program. The code is:
using System; using DTOLib; namespace dtoTest { class Class1 { [STAThread] static void Main(string[] args) { //Code to create an Actian / Pervasive PSQL database using DTO. //Code written by Michael Beris string compName = null; string userName = null; string password = null; string dbname = null; string ddflocation = null; string datalocation = null; dtoDbFlags dbflags = DTOLib.dtoDbFlags.dtoDbFlagDefault; DTOLib.dtoResult result; if (args.LongLength < 1) { Console.WriteLine("Invalid options.\n"); Console.WriteLine("Usage: dtoDBN.EXE <computername> <username> <password> <dbname> <ddf location> <data location> <DBFlage>"); Console.WriteLine("NOTE: locations must be relative to the computer where the PSQL engine is running."); Console.WriteLine("DB Flags must be passed as integer in this example with these values: "); Console.WriteLine(" P_DBFLAG_BOUND = 1; (* bound database - must have P_DBFLAG_CREATE_DDF too *)"); Console.WriteLine(" P_DBFLAG_RI = 2; (*relational integrity *)"); Console.WriteLine(" P_DBFLAG_CREATE_DDF = 4; (*create ddf flag *)"); Console.WriteLine(" P_DBFLAG_NA = 2147483648; (*not applicable *)"); Console.WriteLine(" P_DBFLAG_DEFAULT = (P_DBFLAG_BOUND or P_DBFLAG_RI); "); return; } if (args.LongLength == 7) { compName = args[0].ToString(); userName = args[1].ToString(); password = args[2].ToString(); dbname = args[3].ToString(); ddflocation = args[4].ToString(); datalocation = args[5].ToString(); dbflags = (dtoDbFlags)Convert.ToInt32(args[6]); } Console.WriteLine("Create Pervasive Database using DTO and C#"); DtoSession mDtoSession = new DTOLib.DtoSession(); try { result = mDtoSession.Connect(compName, userName, password); if (result != 0) { Console.WriteLine("Error connecting to server. Error code:"); } else { //Create a Database name here. DtoDatabase db = new DtoDatabase(); db.Name = dbname; db.DdfPath = ddflocation; db.DataPath = datalocation; db.Flags = dbflags; result = mDtoSession.Databases.Add(db); if (result !=0) { Console.WriteLine(string.Format("Error creating the datbase ({0}). Error code: {1}", dbname, result.ToString())); } else { Console.WriteLine(string.Format("Database ({0}) created. ", dbname)); } result = mDtoSession.Disconnect(); Console.ReadLine(); } } catch (Exception e1) { Console.WriteLine(e1.Message.ToString()); } } } }
Scheduled Maintenance
We will be undergoing regular maintenance starting Saturday, December 16, 2017. The site may be intermittently unavailable until Monday, December 18, 2017. We are preparing to move hosts.
Note: Maintenance has been completed, but we are having small technical issues. They should be resolved soon.
Update: All technical issues have been resolved.
Get a list of Pervasive / Actian PSQL databases using C# and DTO
Recently a question came up on how to get a list of all of the database names on a Pervasive / Actian PSQL server from C#. The short answer is to use the DtoDatabase object within the Distributed Tuning Object (DTO) COM object. A reference to the DTO Library will need to be added for this code to work.
This sample is a simple console application that takes three paramaters (ServerName, UserName, Password).
Here’s the code sample that shows how to get the list:
using System; using DTOLib; namespace dtoTest { class Class1 { [STAThread] static void Main(string[] args) { string compName = null; string userName = null; string password = null; DTOLib.dtoResult result; if (args.LongLength < 1) { Console.WriteLine("Invalid options.\n"); return; } if (args.LongLength == 3) { compName = args[0].ToString(); userName = args[1].ToString(); password = args[2].ToString(); } Console.WriteLine("List Pervasive Database using DTO and C#"); DtoSession mDtoSession = new DTOLib.DtoSession(); try { result = mDtoSession.Connect(compName, userName, password); if (result != 0) { Console.WriteLine("Error connecting to server. Error code:"); } else { Console.WriteLine("Connected to " + mDtoSession.ServerName); DtoDatabase mDtoDatabase = new DTOLib.DtoDatabaseClass(); int dbnCount = mDtoSession.DSNs.Count; Console.WriteLine("Found " + dbnCount.ToString() + " DBNs"); for (int iCount = 1; iCount <= dbnCount; iCount++) { Console.WriteLine("DBN " + iCount.ToString() + ": "); mDtoDatabase = mDtoSession.Databases[iCount]; Console.WriteLine("Name: " + mDtoDatabase.Name); Console.WriteLine("DDF Path: " + mDtoDatabase.DdfPath.ToString()); Console.WriteLine("Data Path: " + mDtoDatabase.DataPath.ToString()); Console.WriteLine("Flags: " + mDtoDatabase.Flags.ToString()); Console.WriteLine(""); } result = mDtoSession.Disconnect(); Console.ReadLine(); } } catch (Exception e1) { Console.WriteLine(e1.Message.ToString()); } } } }
PSQLDBSearch Released
Mirtheil Software is pleased to announce the release of PSQLDBSearch . PSQLDBSearch is a lightweight Windows application that will search an entire Actian / Pervasive PSQL database for values. PSQLDBSearch can search all of the tables or one table at a time.
More information and a trial download is available at https://mirtheil.com/psqldbsearch.
New Release: WebViser
Mirtheil Software is pleased to announce the release of WebViser. WebViser is a lightweight Windows application that will track and monitor websites on a timed basis. If you’ve ever wanted to know if a web site goes down while you’re not looking, WebViser can help.
More information and a trial download is available at https://mirtheil.com/webviser.
IsCmdBld.exe causes -1073741819 error
Recently while trying to build an InstallShield 2012 InstallScript installation, the Jenkins job failed because IsCmdBld.exe returned an errorlevel of
-1073741819. After searching through various forums and web sites, I found a workaround that involved disabling the .NET dependency scanning. This was done by setting the “.NET Scan at Build” option on the component to “None”. This let the build complete with no errors displayed.
Eventually I also found one post related to an error with the InstallShield dependency scanner. This error was later found to be a known issue in InstallShield 2012. It had been fixed in InstallShield 2013 and InstallShield 2015. The forum post included a link to a Knowledge Base article (https://flexeracommunity.force.com/customer/articles/en_US/ISSUE/Q204455) that includes a hot fix for InstallShield 2012.
WebAPI routes returning 404 error.
Recently, I was working on a WebAPI project and had it working in Visual Studio 2013 using IIS Express. Then I deployed it to a standard IIS running on Windows 7 and everything failed. Status 404 was being returned from all routes. I tried all of the standard troubleshooting options but finally found the problem.
My Application Pool was set to .NET 2.0. I reset it to .NET 4.0 and everything started working just fine.
Welcome!
Welcome to Mirtheil Software. We hope you find what you are looking for.