Page 1 of 1

ODBC Error

Posted: Fri Jan 21, 2022 11:01 pm
by cmhjon
Hi all,

I am trying to connect LC to a Progress/OpenEdge database (which is a commercial product) via ODBC connection. When I try to connect, I get a "The specified DSN contains an architecture mismatch between the Driver and Application" error which appears to be a 32bit/64bit issue. The installed ODBC driver that comes with the DB is 32bit (I cannot obtain a 64bit driver) and I can successfully connect to the DB via the Windows ODBC Data Source Administrator so I know the connection works. I am using LC 9.6 on a Windows 10 Pro 64bit PC.

Here's my LC code (actual connection parameters have been removed for confidentiality):

Code: Select all

on mouseUp
   put "<ip address>:<port>" into tDBurl
   put "<database name>" into tDBname
   put "<user name>" into tDBuser
   put "<password>" into tDBpword
   
   put revOpenDatabase("ODBC", "Progress", tDBurl, tDBname, tDBuser, tDBpword) into gConID
   
   if gConID is not a number then
      put "Error: " & gConID into field "Result"
      exit mouseUp
   else
      put "Connection Established!" into field "Result"
      put gConID into field "IDconex"
   end if
   
   #close the DB connection
   revCloseDatabase gConID
   put "Connection Closed." into field "IDconex"
end mouseUp
Anyone have suggestions?

Thank you so much!
Jon :)

Re: ODBC Error

Posted: Sat Jan 22, 2022 5:35 am
by cpuandnet
Are you using LC 32-bit as well?

Re: ODBC Error

Posted: Mon Jan 24, 2022 2:07 pm
by cmhjon
Hi cpuandnet,

I installed the 32bit version of LC and now I get a different error:

Error: [DataDirect][ODBC Progress OpenEdge Wire Protocol driver]Socket closed.

Any ideas?
Jon

Re: ODBC Error

Posted: Mon Jan 24, 2022 3:25 pm
by matthiasr
Hi Jon,

did you already do a Google search for that error message?
There are some results for

One leads to a this here, which describes what may cause that error message
https://knowledgebase.progress.com/arti ... dbc-driver

Maybe you have a look at it if there is no other help here.

Regards,
Matthias

Re: ODBC Error

Posted: Mon Jan 24, 2022 4:27 pm
by cmhjon
Hi Matthias,

Yes, I did Google the error and saw the very page you referenced. What doesn't make sense to me is that I CAN achieve a successful connection with the Windows ODBC Data Source Administrator but not with LC:

ODBC.jpg

Maybe there's something missing or not correct in my code?

Code: Select all

   put "JFH1:2701" into tDBurl
   put "gams1" into tDBname
   put "jmorg" into tDBuser
   put "<password>" into tDBpword
   
   put revOpenDatabase("ODBC", "Progress", tDBurl, tDBname, tDBuser, tDBpword) into gConID
Best regards,
Jon

Re: ODBC Error

Posted: Mon Jan 24, 2022 4:44 pm
by matthiasr
The only difference to my call of the revopenDatabase function (i connect to MSSQL) is that i do not include a parameter for the hostAddress itself, as this is normally defined in the DSN.

So according to your sample i would assume, that "Progress" is the name of the user or system DSN you've created with the ODBC Data Source Administrator tool on Windows, right?
So the call of revOpenDatabase would look like this without the hostAddress parameter.

Code: Select all

put revOpenDatabase("ODBC", "Progress",, tDBname, tDBuser, tDBpword) into gConID

Re: ODBC Error

Posted: Mon Jan 24, 2022 5:59 pm
by cmhjon
I tried your suggestion and still got the same error :(

Thank you for your help though!!

Re: ODBC Error

Posted: Mon Jan 24, 2022 6:05 pm
by cmhjon
Screen Shot 2022-01-24 at 12.03.42 PM.jpg

Re: ODBC Error

Posted: Mon Jan 24, 2022 6:41 pm
by cpuandnet
Just as a test, try using a DSN-less connection and see what happens

Code: Select all

put "DRIVER={Progress OpenEdge 11.6 Driver};HOST=JFH1;PORT=2701;DB=gams1;UID=jmorg;PWD=" & tDBpword & ";DIL=0" into tDatasource
put revOpenDatabase("ODBC", tDatasource,,,) into gConID
I rarely use user, system or file DSNs anymore because it eliminates just one more step where something could be setup wrong.

You can find more information here:
https://knowledgebase.progress.com/arti ... exibility.

Good luck!

Re: ODBC Error

Posted: Mon Jan 24, 2022 8:06 pm
by cmhjon
Tried your suggestion. Got the following error:

Error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length

Re: ODBC Error

Posted: Mon Jan 24, 2022 10:06 pm
by SparkOut
I think LC might still have a problem with fileDSN even aftee all this time

viewtopic.php?p=10598#p10598

Re: ODBC Error

Posted: Tue Jan 25, 2022 8:52 pm
by cpuandnet
Have you tested connecting through ODBC from another application besides LC such as Excel or Access?

Re: ODBC Error

Posted: Tue Jan 25, 2022 9:28 pm
by matthiasr
SparkOut wrote:
Mon Jan 24, 2022 10:06 pm
I think LC might still have a problem with fileDSN even aftee all this time

viewtopic.php?p=10598#p10598
Not only with fileDSN, also with odbc connection strings on macOS since LC7 (2016). :cry:
https://quality.livecode.com/show_bug.cgi?id=18151

Re: ODBC Error

Posted: Fri Jan 28, 2022 5:45 pm
by cmhjon
Hi all,

The solution was to add the Progress data source to the User DNS tab in the ODBC Administrator. Now the connection works :)

Thanks to everyone for their help! :)

Best regards,
Jon :)