Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1559
  • Last Modified:

How to connect Classic ASP 32 bits on windows 2008 64 bits using IBM DB2 ODBC DRIVER?

I am trying to connect a classic asp application to a db2 database using the IBM DB2 ODBC DRIVER, this code works perfectly in 32 bits environment, and i need this to run in a windows 2008 64 bits ii7, i already enabled the 32 bits option in the application pool,also i ran the command c:\Windows\SysWOW64\odbcad32.exe to configure the odbc in 32 bits, the odbc works perfectly with .net applications using oledb, but i cant still make it work in classic asp using code like the one below (demo).

ConnectionString = "DSN=MYDSN;UID=user;PWD=password;"
Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.Open(ConnectionString)

it breaks after running MyConnection.Open(ConnectionString)  the error unfortunatelly says error occurred on the server when processing the URL, and if i try to show the err.description it says [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

the DSN in 64 bits has the same name as the DSN in 32 bits, so i decided to try using a different name "MYDSN_32" but i get this other error.

[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

thank you in advance for all your recommendations.
0
Jonathan Gama
Asked:
Jonathan Gama
  • 5
  • 4
1 Solution
 
CSI-WindowsCommented:
ASP is interpreted, so it will run as 64-bit when run on a 64-bit machine.

Setting up the 64-bit DSN is one possible way, but you may wish to look into a 32-bit application pool rather than trying to configure the application to use 32-bit .NET and 64-bit ASP processing.

Here is a how to document: http://help.webcontrolcenter.com/KB/a1114/how-to-enable-a-32-bit-application-pool-in-iis7-dedicatedvps.aspx
0
 
Jonathan GamaAndroid DeveloperAuthor Commented:
Thank you CSI-Windows, its true the fact that it asp classic runs in 64 bits, but anyway i keep having this errors, no mather what combination i use, i keep having error like these ones

"IUSR" does not have the authority to perform the requested command or operation.
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
Unknown error

i will appreciate if some one of you have had this issue before, tell me if this is related to
privileges
missconfiguration
driver defects
etc
0
 
CSI-WindowsCommented:
gesban,
You did not clarify whether you attempted to run the site in a "32-bit IIS Application Pool" as described in the link I provided in the last post.

Have you tried that?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jonathan GamaAndroid DeveloperAuthor Commented:
Yes , that is one of the first things i did, if you read my question, i have already done that, thanks, but unfortunatelly it didnt work, i am wondering if the problem is related to something that the dba should solve.
0
 
CSI-WindowsCommented:
Sorry that I missed that in your original post!

Here is a thread that suggests it may be SQL permissions for IUSR:

http://support.dynamicai.com/forum/viewtopic.php?f=11&t=335
0
 
Jonathan GamaAndroid DeveloperAuthor Commented:
I have already seen that link and i believe that could be the solution, i will try this approach and post here if that solved my problem, and if does, i will accept the solution, many thanks CSI-Windows.
0
 
Jonathan GamaAndroid DeveloperAuthor Commented:
The solution is a combination of changin the user in the application pool for one with all privileges like the admin and when you enable or disable 32 bits in the application pool , it ionly will work after you restart the iis.
0
 
CSI-WindowsCommented:
gesban,
Could you please clarify whether the user change you mentioned is in the "Application Pool" configuration or the SQL user name in "ODBC Settings"
0
 
Jonathan GamaAndroid DeveloperAuthor Commented:
Of course CSI-Windows, the user i changed was in the Application Pool, as you know, for some weird reason, the IBM  ODBC driver is using not only the user and password i passing through the connection string , but also uses the one that comes in the application pool, is some kind of double login, the user that comes by default in the application pool is the "ApplicationPoolIdentity" , so it has to be changed by your admin account who has all the privileges, and the user i am wrinting in the connection string needs to have access "privileges" to connect to the database (this is done by the dba).

Thank you very much for your help CSI-Windows.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now