Is Connecting to a Database still broken?

Sadhunathan Nadesan sadhu at castandcrew.com
Mon May 7 13:26:14 EDT 2007


>
>
>I've got an app that connects with Postgresql database just fine as long 
>as I'm using the IDE.  When I tried to make either a stand-alone or use 
>stackRunner to launch the finished app, I get an "invalid Database type" 
>error.  I have the revdb.dll in the same folder as the stack, and the 
>Externals/Database Drivers folder under it with the postgresql.dll in 
>that folder.  I set the "Database Drivers" to the correct place in the 
>app before I use it. 
>
>This problem has been brought up before but I can't find that it was 
>ever solved.  I can't believe that such a glaring bug would still remain 
>after over a year so I'm thinking I must be doing something wrong.  I 
>have played with the capitalization of the database type (postgresql, 
>Postgresql, PostgreSQL, etc) but it still gives me the error.
>
>Any advice on what I can try next?
>
>Thanks,
>
>Len Morgan
>


Len,

Works for me?  Well, I have an app that I wrote several years back which 
I recently ported to the latest version of Rev for Windows XP and Vista, 
it connects to a PostgreSQL database on my web server just fine. IE, 
it's been working for years.  Of course, that is hardly enough 
information.  Any bug report is best served by detailing 3 elements

*What did you expect?
*What did you get instead
*How to duplicate this problem?

So info like your platform, versions of postgres and rev and OS, sample 
of your code, etc, needed.  Not that I am offering to solve this problem 
but I can look up a code snippet of mine and supply it.  There are of 
course all sorts of things required beyond the code - setting the right 
flags when starting the postgres daemon, opening the right ports in the 
firewall, etc.  Here's some code, where nn.nn.nn.nn = ipaddress or 
domain name, and the rest of the fields are to be filled in with real 
values too.  Also, I'm not sugesting this example be emulated, only that 
it works for me.

Hope it helps
Sadhu

---------------------------------------------------------
on openStack
  global pConnectionID, tSQLQuery, tCursor, tColumnNames
  put "Stand by, I'm connecting to your data base ..." into field "title"
  put 
revOpenDatabase("Postgresql","nn.nn.nn.nn","dbname","username","password") 
into pConnectionID
  if (pConnectionID) is a number then
    put "Your cardfile data base on your home web server opened 
successfully with connection ID " into tResult
    put pConnectionID after tResult
    answer tResult
    AzzClear
  else
    answer "Gosh darn, what's up?  The data base connection failed."
   (etc, code snipped out here)
end openStack
---------------------------------------------------------




More information about the use-livecode mailing list