Windows Vs Mac OSX Compile errors

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Gary SD
Posts: 3
Joined: Fri Apr 24, 2015 11:02 am

Windows Vs Mac OSX Compile errors

Post by Gary SD » Fri Apr 24, 2015 11:25 am

Hi all,

I am writing a commercial application in which i need to connect to an existing MySql database, my development machine is a Mac so I can adapt to IOS mobile if required in future.

So currently the application supports Windows and OSX which is perfect for the end users, however...... The code being used (Below) will not compile / accept a connection for either OSX or Windows once built as a standalone or even in the debug area within LC. I then switched to a Windows machine simply copied and pasted the below code, built a standalone for both platforms and it was successful for both.

Code: Select all

on mouseUp
      global gConnectionID

    put "Address" into tDatabaseAddress
    put "Name" into tDatabaseName
    put "User" into tDatabaseUser
    put "Password" into tDatabasePassword
    
    put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
    
    if tResult is a number then
       put tResult into gConnectionID
      
       answer info "succefully connected!!" & cr & "Connection ID = " & gConnectionID
    else
        put empty into gConnectionID
        answer error "Unable to connect." & cr & tResult
    end if
end mouseUp
I am quite confused as thought the handler would work on both Windows and OSX. Have I missed anything which needs to be added to a OSX version? The application is almost 80% completed and simply needs a connection to the database. I can not seem to find an immediate answer.

Any help would be appreciated.

Gary

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Windows Vs Mac OSX Compile errors

Post by Klaus » Fri Apr 24, 2015 11:31 am

Hi Gary,

1. welcome to the forum! :D

2. What does the compile error say?

You could also try lowercase for the db type -> mysql
Should not matter very much for the desktop, but who knows :D

And make sure that your hoster really accepts DIRECT database access!
Most providers require a "middleware" (like PHP or Livecode server etc.) for security reasons.


Best

Klaus

Gary SD
Posts: 3
Joined: Fri Apr 24, 2015 11:02 am

Re: Windows Vs Mac OSX Compile errors

Post by Gary SD » Fri Apr 24, 2015 11:41 am

Hi Klaus thanks for the welcome and quick response :D

The error is as follows: stack "NnNme": execution error at line 9 (Function: error in function handler) near "revOpenDatabase". char 9

Thanks I just tried low case but ended up with the same result.
I have direct access with an account specially made for the application, the same application at the same dev build works on a windows machine once a standalone is created.

I have developed with a MAC for years on LC and had no errors like this previously. Very strange.

Thanks

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Windows Vs Mac OSX Compile errors

Post by Klaus » Fri Apr 24, 2015 11:56 am

Hi Gary,

hm, really strange, since the syntax is definitively correct!?
Sorry, no brilliant idea in the moment...


Best

Klaus

Gary SD
Posts: 3
Joined: Fri Apr 24, 2015 11:02 am

Re: Windows Vs Mac OSX Compile errors

Post by Gary SD » Fri Apr 24, 2015 12:10 pm

Thanks for your help Klaus i appreciate it,

Anybody able to replicate my problem?

I want to develop in OSX and do not want to switch to Windows however at this moment in time i see no other alternative which is very frustrating. :|

Thanks

Gary

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7227
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Windows Vs Mac OSX Compile errors

Post by jacque » Fri Apr 24, 2015 5:30 pm

Double check that the database library is included in standalone settings.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Windows Vs Mac OSX Compile errors

Post by MaxV » Wed May 06, 2015 10:54 am

Probably just change livecode version.
However what is the result of: answer error "Unable to connect." & cr & tResult ?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Databases”