Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

a few questions?


1 reply to this topic

Perucho

Perucho
  • Members
  • 1 posts

Posted 29 July 2004 - 18:40

1. How do you check for IE version? Is there a feature?

2. How do you check for IIS version? Is there a feature?

3. Object ODBC 3.51 - Using the ODBC Wizard, how do you create an ODBC System DSN for SQL Server with attributes initialized (most importantly the attributes LoginID and Password to connect with SQL Server)? My problem is that
the ODBC Wizard only sees already available data sources?

I know how to initialize attributes using oObj.InstallDataSource(), but LoginID and Password are not working. Any ideas?

Also the DSN is not uninstalling, eventhough I set the bUninstall flag?




pkershaw

pkershaw
  • Members
  • 2 posts

Posted 26 August 2004 - 19:37

I hope this helps with the data source portion of your question. I know it's been a while since you posted, but I just joined today.

The big trick to gettting into the System vice User is to set:
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

Note that at the end, I do a cleanup for User segregate instances of this DSN.

Regards,
Patrick

edit in >> sorry it is so hard to read, the post manager stripped all of my indent white space!


///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupDataSrcA
//
// Purpose: This function uses a registry functions to setup the SQL
// data source on the target system.
//
// This function also modifies the datasource line in the metcal.ini
// file.
//
// File:
//
// Return: Return value is 0 for successful completion
// -1 for failure
//
///////////////////////////////////////////////////////////////////////////////

function SetupDataSrcA()
number nrtn, ni;
number nvSize, nvType;
number nRemote;
string szDLL2;
string sBuf[256];
string szDriverName, szDsnName, szDriverDLL, szDBName, szCommLinks;
string svNextIdIni, svBuf, szKey, szNumName, svNumValue;

begin
starttime:

// this is to retrieve the user selected database alias from
// an INI style file I use to store perpetual data.
svNextIdIni = SVSHAREDEXEPATH ^ "next_id.ini";
ni = GetProfString(svNextIdIni, "Database", "Name", svBuf);
szDBName = svBuf;

// set up to add data for a Sybase SQL Anywhere 8 DB
szDriverName = "Adaptive Server Anywhere 8.0";
szDsnName = "Calibration Data";
szCommLinks = "SharedMemory,TCPIP{}";
if(RegDBKeyExist(CLSID_DBCLIENT8_DLL) = 1) then
// get the database client DLL
szKey = CLSID_DBCLIENT8_DLL ^ "InprocServer32";
szNumName = "";
ni = RegDBGetKeyValueEx (szKey, szNumName, nvType,
svNumValue,nvSize);
if (ni = 0) then
// need to strip off the path to dboledb8 and substitute
// dbodbc8 instead
ParsePath(svBuf, svNumValue, PATH);
szDriverDLL = svBuf ^ ODBC_DRIVER;
else
szDriverDLL = TARGETDIR ^ "win32" ^ ODBC_DRIVER;
endif;
else
szDriverDLL = TARGETDIR ^ "win32" ^ ODBC_DRIVER;
endif;

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

RegDBCreateKeyEx("SOFTWARE\\ODBC\\ODBCINST.INI" ^
szDriverName,"");

RegDBSetKeyValueEx("SOFTWARE\\ODBC\\ODBCINST.INI" ^ szDriverName,
"Driver", REGDB_STRING, szDriverDLL, -1);
RegDBSetKeyValueEx("SOFTWARE\\ODBC\\ODBCINST.INI" ^ szDriverName,
"Setup", REGDB_STRING, szDriverDLL, -1);

RegDBCreateKeyEx("SOFTWARE\\ODBC\\ODBC.INI" ^ szDsnName,"");

RegDBSetKeyValueEx( "SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources",
szDsnName, REGDB_STRING, szDriverName, -1 );
RegDBSetKeyValueEx( "SOFTWARE\\ODBC\\ODBC.INI" ^ szDsnName,
"Driver", REGDB_STRING, szDriverDLL, -1 );

if (szDBName != "") then
RegDBSetKeyValueEx( "SOFTWARE\\ODBC\\ODBC.INI" ^ szDsnName,
"EngineName", REGDB_STRING, szDBName, -1 );
endif;

RegDBSetKeyValueEx( "SOFTWARE\\ODBC\\ODBC.INI" ^ szDsnName,
"CommLinks", REGDB_STRING, szCommLinks, -1 );


// deletes the DSN "Calibration Data" from the User DSN area
// unfortunately this probably only affects the registry of the
// installing user. other users on the same machine may still
// have DSNs in their local machine sections which conflict
// with the DSN we set up in the System DSN area. Note that
// user DSN is preferentially taken over the system DSN.
RegDBSetDefaultRoot(HKEY_CURRENT_USER);

RegDBDeleteValue("SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources",
szDsnName);
RegDBDeleteKey("SOFTWARE\\ODBC\\ODBC.INI" ^ szDsnName);

// sets the Registry pointer back to the root to make it ready for the
// next call.
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
if (ModDSNinINI(szDsnName) < 0) then
sBuf = "Modify DSN in METCAL.INI unsuccessful. Modify manually.";
MessageBox(sBuf, WARNING);
endif;

returntime:
UnUseDLL(szDLL2);

return nrtn;

end;

Edited by pkershaw, 26 August 2004 - 20:56.