.ad 8
.bm 8
.fm 4
.bt $Copyright by SAP AG, 1997$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SAP AG$ADABAS FOR R/3$VTT01OC$

.tt 2 $$$
.tt 3 $$$1997-10-28$
***********************************************************
.nf


    ========== licence begin  GPL
    Copyright (C) 2001 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end

.fo
.nf
.sp
Module  :
=========
.sp
Purpose :
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :

.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :

.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :

.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : Burkhard Diesing
.sp
.cp 3

Created : 1997-12-05
.sp
.cp 3
Version : 1997-12-05
.sp
.cp 3
Release :      Date :
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:

.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:

.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:

.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
/*PRETTY*/

/* upddsn.c */
#ifndef WIN32
int main(int argc, char ** argv)
{
  printf("upddsn not yet implemented\n");
  return(-1);
}
#else
#include "stdio.h"
int __stdcall SQLWritePrivateProfileString(char *lpszSection,	char *lpszKey, 
	char *lpszString, char *lpszFile);	

int main(int argc, char ** argv)
{
  if ( argc <= 2 ) {
      printf("Usage : upddsn DSN Key [ String ].\n");
	  return(-1);
  }
  else
  {
  	char *lpszDSN, *lpszKey, *lpszString, *p;
	lpszDSN = argv[1];
	lpszKey = argv[2];
	lpszString = argv[3];
	if (lpszDSN) {
	for(;*lpszDSN == '"' || *lpszDSN == ' ';) lpszDSN++;
	for(p=lpszDSN+strlen(lpszDSN)-1;p>lpszDSN && *p == '"' || *p == ' ';p--)
		*p = '\0';
	}
	if (lpszKey) {
	for(;*lpszKey == '"' || *lpszKey == ' ';) lpszKey++;
	for(p=lpszKey+strlen(lpszKey)-1;p>lpszKey && *p == '"' || *p == ' ';p--)
		*p = '\0';
	}
	if (lpszString) {
	for(;*lpszString == '"' || *lpszString == ' ';) lpszString++;
	for(p=lpszString+strlen(lpszString)-1;p>lpszString && *p == '"' || *p == ' ';p--)
		*p = '\0';
	}

	return(SQLWritePrivateProfileString(lpszDSN, lpszKey, lpszString, "ODBC.INI"));
  }
}
#endif
.CM *-END-* code ----------------------------------------
.sp 2
***********************************************************
*-PRETTY-*  statements    :           0
*-PRETTY-*  lines of code :           0
*-PRETTY-*  lines in file :           0
.pa

