I should have read your bug report more closely.
It's just an incorrect status report. As I was working on a
development box, test PostgreSQL server, the accounts had no
password. Once I assigned a password, I was able to select databases
besides the one named the same as the username.
However, I can verify that your bug report was 100% dead on what I am
experiencing. This is on an intel iMac, OS X 10.5.2, and RealBasic
2008 R1.
Regards,
Robert
On Apr 30, 2008, at 10:22 AM, Robert Lawrence wrote:
> Norman:
>
> Thanks for the tip. It brings to light another oddity. Playing
> with this revised code (based on your idea), it looks like its
> connecting to the database that has the same name as the username.
> It's ignoring the DatabaseName completely.
>
> Dim db as PostgreSQLDatabase
> Dim rs as RecordSet
>
> db = New PostgreSQLDatabase
> db.host = fldHost.Text
> db.port = Val(fldPort.Text)
> ' db.DatabaseName = fldDatabase.Text
> db.DatabaseName = "postgres"
>
> db.Username = fldUser.Text
> db.Password = fldPassword.Text
>
> if db.connect then
> MsgBox "Congratulations! Communications with database verified."
>
> rs = db.SQLSelect("select current_database()")
> if rs.RecordCount = 1 then
> msgbox "Connected to " + rs.IdxField(1).StringValue
> end if
>
> db.close
> else
> MsgBox "Uh oh! Something is wrong. Check the server details and
> firewall settings."
> end if
>
>
> Notice that I hardcoded .DatabaseName to "postgres". I use my
> "rbtest" username when I run this code. It tells me it connected to
> "rbtest" database. I changed DatabaseName to "rbtest" and tried to
> login as postgres user. It connected to the postgres database.
>
> Something is definitely weird here.
>
> Regards,
> Robert
>
>
> On Apr 30, 2008, at 10:03 AM, Norman Palardy wrote:
>
>> dim rs as RecordSet = db.SQLSelect("select current_database()")
>>
>> if not rs is nil then
>> msgbox "Connecte to " + rs.IdxField(1).StringValue
>> end if
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|