Automatic Data Entry

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Oct 29 16:39:53 CDT 2004


On 10/29/04 4:23 PM, "Kim Kohen" <kim at torchpublishing.com.au> wrote:

> G'day Ruslan
> 
>> Well. Show on list your example of RB + mySQL
>> Few lines of code.
> €€€€
> OK, display cursor in listbox without binding:
> 
>       TextWindow.ListBox2.deleteAllRows
>       While not rs.eof
>         TextWindow.ListBox2.addrow("")
>         For i = 1 to rs.fieldcount
>           TextWindow.ListBox2.cell(TextWindow.ListBox2.lastIndex,i
> -1)=rs.IdxField(i).StringValue
>         next
>         rs.MoveNext
>       wend

 dim curs as VCursor

 Mydb.open( location )

 curs = mydb.SqlSelect( s )

      TextWindow.ListBox2.deleteAllRows
  
      curs.FirstRecord
      do
        TextWindow.ListBox2.addrow("")
        For i = 1 to curs.fieldcount
          TextWindow.ListBox2.cell(TextWindow.ListBox2.lastIndex,I ­1 ) =
curs.Field(i).GetString
        next       
      until curs.NextRecord() = false

> Also, a basic query using primary key - I don't understand how to directly
> query the RecID when it's a 'hidden' field.
> 
>   if mydb.connect() then
>   s = "select ID, story_name, heading, sub_heading, caption, body,
> story_writer, section, publication, depth, page, comment from stories where
> ID='"+str(storyID)+"'"
> 
>  there's others but these come to mind immediately.

Simply Kim:

   s = "select RecID, story_name, heading, sub_heading, caption, body,
  story_writer, section, publication, depth, page, comment from stories
where


If you need join tables then

    SELECT ..
    FROM T1, T2
    WHERE T1.RecID = T2.ObjectPtr


You can use RecID by name.
You can read and compare its values.
Just you can be lazy and do not set its values :-)


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list