New topic: 

perpare statement bug?!

<http://forums.realsoftware.com/viewtopic.php?t=45871>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        kgingeri          Post subject: perpare statement bug?!Posted: 
Sun Nov 11, 2012 5:08 pm                         
Joined: Fri Nov 02, 2012 1:45 am
Posts: 9
Location: Ontario, Canada                Hi All, 
Some background; I'm new to Real Studio and Real Basic.
I'm using a Mac and the trail version of RS - wanting to use the Web edition.

I have spent several hours now sorting out what seems to be a bug! 
Here is my code snippet (BTW, this is a MySQL database)...
' ...db is a properly define MySQL obj
Dim stmt As MySQLPreparedStatement
stmt = MySQLPreparedStatement(db.Prepare("SELECT * FROM guests WHERE ? LIKE ?") 
)
stmt.BindType(0, MySQLPreparedStatement.MYSQL_TYPE_STRING)
stmt.BindType(1, MySQLPreparedStatement.MYSQL_TYPE_STRING)

Dim rs as RecordSet

'  rs = db.SQLSelect("SELECT * FROM guests WHERE postal_code LIKE '%y5r%'")  
'...works, returns one valid rec
rs = stmt.SQLSelect("postal_code","%y5r%") '...doesn't work - no field values?!

if rs <> NIL then
  MsgBox "Data id = [" + rs.Field("id").StringValue + "]"
end if


Note: I have 2 params in stmt so I can check the users entry against more then 
one field in the record db - i.e. postal_code, lastname etc...

The results are that the commented SQLSelect line works fine, and I get back a 
single 'id' value with BOF and EOF both false - which is what I expect.
However, the uncommented line, produces a non-Nil rs value with BOF and EOF 
true, and 'id' is blank (or any of the fields for that matter)

Is my noobiness showing here or what?   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to