Hi there, I have a bit of a situation with an in-house 32bit app we have. We have vs.net 2005 installed on an Xp Pro SP3 machine, and has the .net framework 2.0 installed. We used to have a full time developer but he has left the company and now I am supporting these apps. I do not want to touch his development PC as he had it set up just so...
I come from an app dev background and have developed some vb apps so I'm not a complete newbie but it's not what I did a lot of anymore, till now! There's the background for ya...
So, we have this custom app which uses an ODBC (32bit) Pervasive SQL driver to access accounting data from our Business Visions accounting database. It has worked fine for years - as all of our machines were 32bit systems. Enter the first 64 bit system that needed to have this particular functionality available for the end user. When the user attempts to access this functionality, the app fails miserably. I am getting the following error when trying to open the Pervasive SQL dataset... below is the line of code that fails. This code is located in a function that attemts to validate the connection to the accounting data using the odbc connection...
Dim objConn As Microsoft.Data.Odbc.OdbcConnection
The error I get is... "Unable to find an entry point named InterlockedIncrement in DLL kernel32.dll"
Now, I did some research and found a couple of things to try... 1) I thought that maybe Pervasive SQL might have a 64 bit version of their driver -they do not. 2) One fellow said to use the "system.data.odbc.odbcconnection" class instead of the "microsoft,data.odbc.odbcconnection" class but that failed with a "The specified DSN contains an architecture mismatch between the driver and the application." .
What I think is happening after researching a little further is that on 64 bit systems, the 64 bit version of "kernal32.dll" is stored in the c:\windows\system32 folder while the 32bit version of it is stored in a different folder (c:\windows\sysWOW64). Apparently through 'redirection", an application is supposed to be loading the appropriate 32 or 64 bit dll's from either system32 or syswow64 depending on whether the app is 32 or 64 bit. I do not think this is happening in my case. I suspect it is loading the 64bit version of kernal32.dll from the system32 folder and in that version, the method interlockedincrement does not exist and has been replaced by interlockedincrement64 - which if there had been a 64 bit version of the Pervasive odbc driver, likely would have called that 64 bit function instead and all would have been fine!!!
I also discovered that there is no "compatibility mode" settings in vs.net 2005 which some folks referred to having to set in your project in order to have your 32bit app use the correct folder to load the 32bit dll's...
Does anyone know what I can do? I am assuming I am going to have to explicitly load the 32 bit kernal32.dll file from the c:\windows\syswow64 folder correct? How does one go about specifying that in a vb.net 2005 project or if anyone has any other ideas, please let me know...
Thanks!
I come from an app dev background and have developed some vb apps so I'm not a complete newbie but it's not what I did a lot of anymore, till now! There's the background for ya...
So, we have this custom app which uses an ODBC (32bit) Pervasive SQL driver to access accounting data from our Business Visions accounting database. It has worked fine for years - as all of our machines were 32bit systems. Enter the first 64 bit system that needed to have this particular functionality available for the end user. When the user attempts to access this functionality, the app fails miserably. I am getting the following error when trying to open the Pervasive SQL dataset... below is the line of code that fails. This code is located in a function that attemts to validate the connection to the accounting data using the odbc connection...
Dim objConn As Microsoft.Data.Odbc.OdbcConnection
The error I get is... "Unable to find an entry point named InterlockedIncrement in DLL kernel32.dll"
Now, I did some research and found a couple of things to try... 1) I thought that maybe Pervasive SQL might have a 64 bit version of their driver -they do not. 2) One fellow said to use the "system.data.odbc.odbcconnection" class instead of the "microsoft,data.odbc.odbcconnection" class but that failed with a "The specified DSN contains an architecture mismatch between the driver and the application." .
What I think is happening after researching a little further is that on 64 bit systems, the 64 bit version of "kernal32.dll" is stored in the c:\windows\system32 folder while the 32bit version of it is stored in a different folder (c:\windows\sysWOW64). Apparently through 'redirection", an application is supposed to be loading the appropriate 32 or 64 bit dll's from either system32 or syswow64 depending on whether the app is 32 or 64 bit. I do not think this is happening in my case. I suspect it is loading the 64bit version of kernal32.dll from the system32 folder and in that version, the method interlockedincrement does not exist and has been replaced by interlockedincrement64 - which if there had been a 64 bit version of the Pervasive odbc driver, likely would have called that 64 bit function instead and all would have been fine!!!
I also discovered that there is no "compatibility mode" settings in vs.net 2005 which some folks referred to having to set in your project in order to have your 32bit app use the correct folder to load the 32bit dll's...
Does anyone know what I can do? I am assuming I am going to have to explicitly load the 32 bit kernal32.dll file from the c:\windows\syswow64 folder correct? How does one go about specifying that in a vb.net 2005 project or if anyone has any other ideas, please let me know...
Thanks!