I added

  If Not DB.Connect Then 
    MsgBox "DB not connected"
  End If
  
before 

  RS = DB.SQLSelect("Select fname, lname, empno from people where active
= 'true' order by lname, fname") 

and (1) I don't get the message box and (2) I still get the same error.

Paul Dobbs
Software Engineer, Staff 
Lockheed Martin Missiles and Fire Control
Phone (972) 603-1244
Fax (972) 603-2017

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian
M. Jones
Sent: Tuesday, September 05, 2006 4:06 PM
To: REALbasic NUG
Subject: Re: Database problem

Maybe something is happening to your DB connection between the working
SQLSelect and the failing one.

Are you (can you) test the connection before this SQLSelect with the
error?

On 5 Sep 2006, at 18:18, Dobbs, Paul wrote:

> The error is 1.
> The message is "SQL logic error or missing database."
>
> Another table in the same database is read with no problem just before

> this problem comes up, using a similar select statement:
> RS = DB.SQLSelect("Select cname from computers order by cname") And 
> that makes me reasonably certain that the database is not missing.
>
>
> Paul Dobbs
> Software Engineer, Staff
> Lockheed Martin Missiles and Fire Control Phone (972) 603-1244 Fax 
> (972) 603-2017
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ian

> M. Jones
> Sent: Tuesday, September 05, 2006 12:04 PM
> To: REALbasic NUG
> Subject: RE: Database problem
>
> What's the error message and code you get back, I don't think you've 
> mentioned that yet?
>
>
> On Tue, September 5, 2006 15:01, Dobbs, Paul wrote:
>> I finally tried what I should have tried to begin with -- I removed 
>> the where clause from the select statement. In fact, I also removed 
>> the 'order by' clause. The statement is now:
>>
>> RS = DB.SQLSelect("select fname, lname, empno from people")
>>
>> I'm still getting the same error. I have checked using another 
>> program
>
>> which shows the database schema, and the table name "people" is 
>> correct, as are the field names "fname," "lname" and "empno." So I'm 
>> wiser about where the error is, but I still don't know what it is.
>>
>>
>> Paul Dobbs
>> Software Engineer, Staff
>> Lockheed Martin Missiles and Fire Control Phone (972) 603-1244 Fax
>> (972) 603-2017
>>
>> On Sep 5, 2006, at 3:10 PM, Dobbs, Paul wrote:
>>
>>> I have a database program which I created some time back to track 
>>> access to a secure area. The program (last compiled in April) has 
>>> developed a problem in that it will not add new records. All other 
>>> operations work fine. When I trie to run the program in the IDE so 
>>> that I can look at the problem, it will load the database.
>>>
>>> The problem occurs in the following code:
>>>   RS = DB.SQLSelect("select fname, lname, empno from people where 
>>> active = 'true' order by lname, fname")
>>>   If DB.Error Then
>>>     ReportError "Error while getting names: " + DB.ErrorMessage,
> Error
>>>   Else
>>>     While Not RS.EOF
>>>       Names.Append RS.Field("fname").StringValue + " " + 
>>> RS.Field("lname").StringValue
>>>       EmpNos.Append RS.Field("empno").IntegerValue
>>>       RS.MoveNext
>>>     Wend
>>>   End If
>>>
>>> I always get the "Error while getting names" message.
>>>
>>> I found the following in the release notes for RB2006 R2:
>>>
>>> BooleanColumn (in RecordSets and DatabaseRecords) now write a '1'  
>>> for
>
>>> true and a '0' for false into table fields.
>>> Before they wrote the strings 'true' and 'false
>>>
>>> And the following in the release notes for R3:
>>> REAL SQL Database: Boolean fields are now more pedantic about what 
>>> they expect when using DatabaseField. BooleanValue. Previously, '0'
>>> and 'false' were treated as False and anything else was treated as 
>>> True.
>>> Now, '0' and 'false' are treated as False and '1' and 'true' are 
>>> treated as True. The behavior of any other values is undefined if 
>>> retrieved using DatabaseField.BooleanValue.
>>> DatabaseField.StringValue,
>>
>>> on the other hand, should be able to retrieve the original data if 
>>> it
>
>>> can't be identified as a boolean. If the REAL SQL Database can 
>>> identify the value as a boolean, however, then False will always 
>>> return 'false' and True will always return 'true', regardless of how

>>> those values are stored in the database. This is a side effect of 
>>> the
>
>>> way in which database engines interact with the database API in the 
>>> REALbasic framework. Note that the change to 
>>> DatabaseField.BooleanValue should only be an issue if you are trying

>>> to store non-boolean data in a boolean column.
>>>
>>> Neither seems to tell me just how to fix my problem. I have tried 
>>> "where active = 1", "where active = '1'" and "where active" and all 
>>> give the same results as "where active = 'true'". How can I fix this

>>> problem so that I can go looking for the original problem?
>>>
>>> Paul Dobbs
>>> Software Engineer, Staff
>>> Lockheed Martin Missiles and Fire Control Phone (972) 603-1244 Fax
>>> (972) 603-2017
>>>
>>> _______________________________________________
>>> Unsubscribe or switch delivery mode:
>>> <http://www.realsoftware.com/support/listmanager/>
>>>
>>> Search the archives of this list here:
>>> <http://support.realsoftware.com/listarchives/lists.html>
>>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
>>
>
>
> --
> Ian M. Jones
> ________________________________________
> IMiJ Software
> http://www.imijsoft.com
> http://www.ianmjones.net (blog)
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to