I am working on a project that unfortunately is using a very old version of Sybase (11.5.1 ASE)

I have linked their existing code via a Sybase ODBC connector but have now had success using ADO via jtdbc Java and be able to re-work all of that to one method.

My mission is to not hard code the database server and DB name so I would like to use XML like app.config.xml to store the connection parameters for starters.

Secondly, I want to use an XML parsing method that is not going to be version dependent or at least going to be compatible with XP thru 8 and greater. Since this is a community service organization there is not a lot of funding for many changes as you can tell by the Sybase version that was donated to them. Since they are already using the server for other antique programs right now the simple option of get a new server cant be done. I am already replacing common control usage to address those issues.

Also to mention, this program uses Access Runtime only so many will not have an Office installation.

The <ConnectionDefault> setting will determine which section to retrieve to build the connection string. The client can choose which ever works best and offer some flexibility while still using XP for a while.

Code:
<?xml version="1.0" encoding=”UTF-8”?>"
<SETTINGS>
   <Connection>
     <ConnectionDefault Value="java"> </ConnectionDefault>
	
       <java>
          <ConnectionType Name="ConnectMethod" Value= "JDBC"  />
          <ConnectionType Name="Driver" Value="net.sourceforge.jtds.jdbc.Driver" />
	      <ConnectionType Name="ServerType="ASE-SQL" Value="sybase:" />
          <ConnectionType Name="ServerName="//TEST_MCG" />
		  <ConnectionType Name="ServerTCP="//192.168.10.11" />
          <ConnectionType Name="PortName" Value="5000" />
	      <ConnectionType Name="DataBase" Value="DI" />
          <ConnectionType Name="PropertySettings" Value="[;<property>=<value>[;...]]" /> 
       </java>

       <odbc>
		  <ConnectionType Name="ConnectMethod" Value= "ODBC Direct"  />
		  <ConnectionType Name="ServerType="ASE-SQL" Value="sybase:" />
          <ConnectionType Name="Driver" Value="{SYBASE SYSTEM 11}" />
          <ConnectionType Name="UserString" Value="Uid" />
		  <ConnectionType Name="ServerName" Value="TEST_MCG" />
		  <ConnectionType Name="DataBase" Value="DI" />
       </odbc>
	   
	   <system_dsn>
	      <ConnectionType Name="ConnectMethod" Value= "ODBC DSN"  />
	      <ConnectionType Name="ServerType="ASE-SQL" Value="sybase:" />
          <ConnectionType Name="Driver" Value="{SYBASE SYSTEM 11}" />
          <ConnectionType Name="UserString" Value="Uid" />
		  <ConnectionType Name="ServerName" Value="TEST_MCG" />
		  <ConnectionType Name="DataBase" Value="DI" />
	   </system_dsn>
	   
	   <file_dsn>
	      <ConnectionType Name="ConnectMethod" Value= "FILE DSN"  />
	      <ConnectionType Name="FilePath="\config\dsn\" Value="sybase:" />
	      <ConnectionType Name="ServerType="ASE-SQL" Value="Sybase:" />
          <ConnectionType Name="Driver" Value="{SYBASE SYSTEM 11}" />
          <ConnectionType Name="UserString" Value="Uid" />
		  <ConnectionType Name="ServerName" Value="TEST_MCG" />
		  <ConnectionType Name="DataBase" Value="DI" />
	   </file_dsn>
      </Connection>
</SETTINGS>