Database Exchange Manager on different computers

I trying to use the Database Exchange Manager to edit language files, I have run into (a well documented) problem when I try to use this unction on different machines.  The DSN connection string doesn't seem to allow anything but a fixed string, so when Citect is installed in a different directory, access to "[RUN:]" changes.

TN000029832 goes through the 8 character limitation for the file name, but it seems that may not include the path.

Anybody have ideas on how to redirect the DSN?

Parents
  • Below is a sample code demonstrating what connection strings look like for DBF, Access and MS SQL Server, where "AN34" is the AN occupied by the instance of Database Exchange Manager. For the DBF files, the connection string is just a path where DBF files are located. The name of a DBF file is restricted to 8 characters in length. Try the following sample code that is independent from the installation directory of Citect. Hope it would work for you.

    FUNCTION SetConnection(STRING sDatabaseType)

    STRING sDriver;

    STRING sConnString;

        SELECT CASE sDatabaseType

            CASE "dBase"

                sDriver = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=";

                sConnString = sDriver + PathToStr("[RUN]");

            CASE "Access"

                sDriver = "Driver={Microsoft Access Driver (*.mdb)};Dbq=";

                sConnString = sDriver + PathToStr("[RUN]\CitectDBF.mdb") + ";Uid=admin;Pwd=";

            CASE "SQL Server"

                sConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=localhost";

        END SELECT

        _ObjectSetProperty(ObjectByName("AN34"), "DBConString1", sConnString);

    END

    FUNCTION SelectTable(STRING sTableName)

        _ObjectSetProperty(ObjectByName("AN34"), "RecordSource1", sTableName);

        _ObjectSetProperty(ObjectByName("AN34"), "Caption", sTableName);

    END

Reply
  • Below is a sample code demonstrating what connection strings look like for DBF, Access and MS SQL Server, where "AN34" is the AN occupied by the instance of Database Exchange Manager. For the DBF files, the connection string is just a path where DBF files are located. The name of a DBF file is restricted to 8 characters in length. Try the following sample code that is independent from the installation directory of Citect. Hope it would work for you.

    FUNCTION SetConnection(STRING sDatabaseType)

    STRING sDriver;

    STRING sConnString;

        SELECT CASE sDatabaseType

            CASE "dBase"

                sDriver = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=";

                sConnString = sDriver + PathToStr("[RUN]");

            CASE "Access"

                sDriver = "Driver={Microsoft Access Driver (*.mdb)};Dbq=";

                sConnString = sDriver + PathToStr("[RUN]\CitectDBF.mdb") + ";Uid=admin;Pwd=";

            CASE "SQL Server"

                sConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=localhost";

        END SELECT

        _ObjectSetProperty(ObjectByName("AN34"), "DBConString1", sConnString);

    END

    FUNCTION SelectTable(STRING sTableName)

        _ObjectSetProperty(ObjectByName("AN34"), "RecordSource1", sTableName);

        _ObjectSetProperty(ObjectByName("AN34"), "Caption", sTableName);

    END

Children
No Data