Page 1 of 1

Cannot create a 64bit odbc dsn from a 32bit installation script

Posted: Tue May 03, 2022 9:45 am
by it@audimex.com
Hi,

according to resources in the internet, we try to do this with the following script:

Code: Select all

Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
if Variable ISWINDOWS64BIT Equals TRUE
  Comment: Check 64bit
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end
Comment: Check MSXML60
Comment: CreateOdbcConnection for Perl
Comment: no variables allowed in "Create ODBC DSN"
Check Registry Key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\ into SUCCESS
if Variable SUCCESS not Equals NO$KEY
  if Variable SUCCESS Equals READ$ERROR
    MessageBox: Error, The registry key$NEWLINE$$NEWLINE$HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\110$NEWLINE$$NEWLINE$can not be read!
    Terminate Installation
  end
  Create ODBC DSN audimex_tengelmann (uses driver SQL Server Native Client 11.0)
else
  Check Registry Key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\100\ into SUCCESS
  if Variable SUCCESS Equals NO$KEY
    Create ODBC DSN audimex_tengelmann (uses driver SQL Native Client)
  else
    if Variable SUCCESS Equals READ$ERROR
      MessageBox: Error, The registry key$NEWLINE$$NEWLINE$HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100$NEWLINE$$NEWLINE$can not be read!
      Terminate Installation
    else
      Create ODBC DSN audimex_tengelmann (uses driver SQL Server Native Client 10.0)
    end
  end
end
if Variable ISWINDOWS64BIT Equals TRUE
  Comment: Check 64bit
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end


This code should create a 32bit DSN on a 32bit Windows system, and a 64bit DSN on a 64bit system. But it creates a 32bit DSN, regardless on which system it runs.

What is our problem? How can we fix it?

Kind reagrds,
Markus

Re: Cannot create a 64bit odbc dsn from a 32bit installation script

Posted: Thu May 05, 2022 10:31 am
by FrancescoT
I don't know to which internet resources you are referring to, but here you can find a ready to use "ODBC sample" that demonstrates how to create 32/64 bit ODBC data sources.
https://www.installaware.com/forums/viewtopic.php?f=2&t=6772

Hope this helps you.