PostgreSQL, revOpenDatabase, invalid database type

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
minihold
Posts: 3
Joined: Wed Jul 12, 2006 6:19 am

PostgreSQL, revOpenDatabase, invalid database type

Post by minihold » Wed Jul 12, 2006 8:24 am

I'm currently evaluating (trial license) Revolution 2.7.2 under Mac OSX (PPC) 10.4.7 in combination with PostgreSQL databases.
I'm using following script code, to connect to PostgreSQL:

Code: Select all

put revOpenDatabase("PostgreSQL","dbserver:5432","Statistics","view","secret") into tConnectionID
answer tConnectionID
But I'm getting following error: revdberr,invalid database type
I've read similar mails adressing the dynamic linking problem of db libraries. Therefore I've tried to set the revSetDatabaseDriverPath too. But no change. I've tried to use the Database Query Builder, but this tool reports the same error. The command otool -L on dbpostgresql in the Database Driver/dbpostgresql.bundle directory doesn't complain on missing libraries.
Who can help me fixing this problem?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Wed Jul 12, 2006 7:17 pm

The name of the database type shouldn't be case sensitive, but you might try

Code: Select all

put revOpenDatabase("postgresql","dbserver","statistics","view","secret") into tConnectionID
answer tConnectionID
Also make sure you can connect to the database using some other SQL client, as in rare cases you get the 'invalid database' error when something else is amiss.

Hope this gets you closer to the solution.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

minihold
Posts: 3
Joined: Wed Jul 12, 2006 6:19 am

Post by minihold » Thu Jul 13, 2006 5:36 am

Jan, thx for the tip, but I've used several variations of the database name, eg: PostgreSQL, postgresql, PostGreSQL, pgsql, dbpostgresql (as this is the db driver name), ... In every case I'm getting the invalid database type error message.
For additional info: the db is accessible via command line tool psql and several other test programs written in Java, C, Perl, Python e.g. a REALbasic evaluation application (running on the same frontend/development machine) is able to use the database.
The insteresting thing is that the IDE tool "Database Query Builder" isn't able to connect to the database too. So it's not the code which causes the problem it's a bug or limitation in the setup.
In the meantime I've set up a MySQL database on the same DB server and this database can be connected via RunRev IDE. I wanted to check, if it's a general problem or a specific one.

Here is the output of the otool -L on the database driver libs:

Code: Select all

otool -L dbmysql.bundle/Contents/MacOS/dbmysql dbmysql.bundle/Contents/MacOS/dbmysql:
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 63.0.0)
otool -L dbpostgresql.bundle/Contents/MacOS/dbpostgresql 
dbpostgresql.bundle/Contents/MacOS/dbpostgresql:
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 63.0.0)
I think the trial license has some limitations on the db backends which can be used.
It will be helpfull if someone official can agree on my results or can give some advice to help fixing the problem.

Greatings, Markus

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Mon Jul 31, 2006 12:25 am

Hi Markus,

My apologies for the late reply, but I was on holiday for a little over 2 weeks.
In an older version of Rev, I was having problems with connecting to PostgreSQL databases on MacOS X 10.2
Could you open the 'Console' application (in your Applications folder, in the Utilities subfolder) and see if an error is shown there when you try to open a connection to the PostgreSQL database?

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

andrew@ugh.net.au
Posts: 13
Joined: Sun Dec 17, 2006 12:30 pm

Post by andrew@ugh.net.au » Thu Jan 04, 2007 8:07 pm

It's a bug in Revolution - see my earlier post in this forum. Using the terminal go into Externals/Database Drivers/dbpostgresql.bundle/Contents/MacOS and make sure the file in there is called dbpostges and not dbpostgresql.

My experiements lead me to beleive that the :1, :2 syntax don't always work correctly either - sometimes swallowing or adding quotes - so be careful with that as well.

lmorgan
Posts: 4
Joined: Fri Jan 05, 2007 4:25 pm
Location: Big Spring, TX, USA

Post by lmorgan » Wed May 09, 2007 11:14 pm

This problem does not seem to have been resolved yet. I am trying to connect to a Postgres database on my server. It works fine in the IDE but won't in a standalone launched by stackRunner. I've got the driver in the right place (appfolder/Externals/Database Drivers/) and I've tried every combination of capitalization I can think of.

Len Morgan

andrew@ugh.net.au
Posts: 13
Joined: Sun Dec 17, 2006 12:30 pm

Post by andrew@ugh.net.au » Sat May 12, 2007 8:30 am

I haven't used StackRunner before but I just downloaded it. It doesn't look like in includes any DB drvers at all. Copying the folder "Revolution Player.app/Contents/Externals/Database Drivers/dbpostgresql.bundle" to "StackRunner.app/Contents/MacOS/Externals/Database Drivers" works for me though. Note that my dbpostgresql.bundle has already had its content renamed as per my earlier post.

lmorgan
Posts: 4
Joined: Fri Jan 05, 2007 4:25 pm
Location: Big Spring, TX, USA

Post by lmorgan » Sun May 13, 2007 1:59 pm

Thanks for the answer, Andrew. It sounds like you've got a Mac (I'm on Windows) and this is probably one of those problems that is system specific.

I actually solved this problem a few days ago. It turns out that somewhere along the way, I renamed the "Database Drivers" folder but never changed the code that set the driver location. All is well now and it's working fine.

By the way, I'm now using the altSplash approach instead of the stackRunner since this is available as source code and I can include the drivers with the standalone.

len

Post Reply

Return to “Databases”