Xojo Conferences
XDCMay2019MiamiUSA

openning an existing REALDatabase with RB 4.5 (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Mark@SplitSW.com
Next thread: Re: OSX : drag files on app icon doesn't work... (for Joe)


Re: The basics of text parsing   -   Jan Erik Moström <
  openning an existing REALDatabase with RB 4.5   -   Jules.Jacquot
   Re: openning an existing REALDatabase with RB 4.5   -   Steve Schacht
   Re: openning an existing REALDatabase with RB 4.5   -   Seth Willits

openning an existing REALDatabase with RB 4.5
Date: 31.07.02 23:02 (Thu, 1 Aug 2002 00:02:28 +0200)
From: Jules.Jacquot
Hi all
I have some trouble for to open an existing REALDatabase under RB 4,5
the exemple which is on the top of page 368 of the REALBasic Language
Reference get an db.error.
anyone has the solution ?
thanks for your help

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: openning an existing REALDatabase with RB 4.5
Date: 31.07.02 23:14 (Wed, 31 Jul 2002 16:14:28 -0600)
From: Steve Schacht
On 7-31-2002 4:02 PM, Jules.Jacquot wrote:

> I have some trouble for to open an existing REALDatabase under RB 4,5
> the exemple which is on the top of page 368 of the REALBasic Language
> Reference get an db.error.
> anyone has the solution ?

I think you may have to invoke the Connect method before you're able to work
with the data. See the example under the Database Class in the online LR.

Regards,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: openning an existing REALDatabase with RB 4.5
Date: 01.08.02 00:46 (Wed, 31 Jul 2002 16:46:26 -0700)
From: Seth Willits
On 7/31/02 3:02 PM, the NSA intercepted the following message from
"Jules.Jacquot" <<email address removed>>:

> Hi all
> I have some trouble for to open an existing REALDatabase under RB 4,5
> the exemple which is on the top of page 368 of the REALBasic Language
> Reference get an db.error.
> anyone has the solution ?

Dim dbFile as FolderItem
Dim db as REALDatabase

db=New REALDatabase
dbFile = GetFolderItem("Pubs")
db.DatabaseFile=dbFile

If db = Nil then
Beep
MsgBox "The database couldn¹t be opened."
else
//proceed with database operations here..
end if

Are you referring to this example? This example is misleading and incorrect.
It leads you to believe that simply by setting the DatabaseFile property of
the database, it will open and you can use it. Wrong. This is how it should
be written:

Dim dbFile as FolderItem
Dim db as REALDatabase

db=New REALDatabase
dbFile = GetFolderItem("Pubs")

if dbFile.exists = false then
Beep
Msgbox "No such database."
return // exit
end if

db.DatabaseFile = dbFile
If db.Connect = true then
//proceed with database operations here..
else
Beep
MsgBox "The database couldn¹t be opened."
end if

Database tutorial at http://www.freaksw.com/rb-papers.html I haven't yet
updated it for the new 4.5 syntax but everything is still valid and will
work in 4.5.

I have an example of a complete database application that uses the 4.5
syntax, but I haven't uploaded it yet. Let me know if you want it.

Seth Willits
---------------------------------------------------------------------------
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com

"Sometimes you just gotta think outside the box."
-- Everyone
---------------------------------------------------------------------------


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>