ODBC Error

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

ODBC Error

Post by cmhjon » Fri Jan 21, 2022 11:01 pm

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 :)

cpuandnet
Posts: 32
Joined: Thu Jan 17, 2019 6:43 am

Re: ODBC Error

Post by cpuandnet » Sat Jan 22, 2022 5:35 am

Are you using LC 32-bit as well?

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Mon Jan 24, 2022 2:07 pm

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

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: ODBC Error

Post by matthiasr » Mon Jan 24, 2022 3:25 pm

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

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Mon Jan 24, 2022 4:27 pm

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

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: ODBC Error

Post by matthiasr » Mon Jan 24, 2022 4:44 pm

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

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Mon Jan 24, 2022 5:59 pm

I tried your suggestion and still got the same error :(

Thank you for your help though!!

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Mon Jan 24, 2022 6:05 pm

Screen Shot 2022-01-24 at 12.03.42 PM.jpg

cpuandnet
Posts: 32
Joined: Thu Jan 17, 2019 6:43 am

Re: ODBC Error

Post by cpuandnet » Mon Jan 24, 2022 6:41 pm

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!

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Mon Jan 24, 2022 8:06 pm

Tried your suggestion. Got the following error:

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

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: ODBC Error

Post by SparkOut » 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

cpuandnet
Posts: 32
Joined: Thu Jan 17, 2019 6:43 am

Re: ODBC Error

Post by cpuandnet » Tue Jan 25, 2022 8:52 pm

Have you tested connecting through ODBC from another application besides LC such as Excel or Access?

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: ODBC Error

Post by matthiasr » Tue Jan 25, 2022 9:28 pm

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

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: ODBC Error

Post by cmhjon » Fri Jan 28, 2022 5:45 pm

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 :)

Post Reply

Return to “Databases”