urgent! need help with database bindings 
Author Message
 urgent! need help with database bindings

I do not know why I can't get this to work...I've been pulling my hair
out looking for a tutorial or something...

I need to implement a sql statement like:

"SELECT StudentName FROM " + popupmenu1.text

and populate popupmenu2 (in a different window) with the results.

I can't use the sqlquery property for the databasequery instance for
this type of query as far as i can tell because I have to concatenate
text into it..

the O'Reilly manual only explains this for listboxes which have
different properties.

Sorry if the answer to this is too simple, it's for a school project.



Thu, 12 Aug 2004 13:45:37 GMT  
 urgent! need help with database bindings
[[ This message was both posted and mailed: see
   the "To," "Cc," and "Newsgroups" headers for details. ]]


Quote:

> I do not know why I can't get this to work...I've been pulling my hair
> out looking for a tutorial or something...

> I need to implement a sql statement like:

> "SELECT StudentName FROM " + popupmenu1.text

> and populate popupmenu2 (in a different window) with the results.

> I can't use the sqlquery property for the databasequery instance for
> this type of query as far as i can tell because I have to concatenate
> text into it..

> the O'Reilly manual only explains this for listboxes which have
> different properties.

> Sorry if the answer to this is too simple, it's for a school project.

If I understand your question, what you need to do is use a string
property in your other woindow and pass the sql to it.

so in window one, in the change event of the popup:

window2.sqlproperty = "SELECT StudentName FROM " + popupmenu1.text

then in window2, use that property as your query.

Does that help



Fri, 13 Aug 2004 11:32:40 GMT  
 urgent! need help with database bindings

 Thanks all for your replies..Actually I did what I needed to do at the
time with:

dcurs = d.sQLSelect("select StudentName from " +
winselectClass.popClassTables.text)

  u = dcurs.FieldCount
  me.deleteAllRows
  while not dcurs.eof
    for i = 1 to u
      fld =dcurs.idxfield(i)
      me.AddRow fld.StringValue
    next
    dcurs.movenext
  wend
  d.Close

I don't know if this was the most efficient way, but after hours of
tinkering, this is all that worked. Unfortunately, my next problem is
that I want to select the data and set the captions of an array of
bevelbuttons with the values. I'm trying this:

  dcurs = d.sqlselect("select Subjects from "
+winSelectClass.popClassTables.text)

  u = dcurs.FieldCount

  while not dcurs.eof

    for i = 1 to u
      fld =dcurs.idxfield(i)
      bevelbutton1(i).Caption = fld.StringValue
      bevelbutton1(i).visible = true
      dcurs.Movenext
    next

  wend

  d.Close

but it is only setting the caption of the first button (I've tried
making all buttons visible by default but still only the first has a
caption). Once again pulling out hair.

  Nelson

Quote:
> If I understand your question, what you need to do is use a string
> property in your other woindow and pass the sql to it.

> so in window one, in the change event of the popup:

> window2.sqlproperty = "SELECT StudentName FROM " + popupmenu1.text

> then in window2, use that property as your query.

> Does that help



Mon, 23 Aug 2004 05:09:47 GMT  
 urgent! need help with database bindings
 Thanks all for your replies..Actually I did what I needed to do at the
time with:

dcurs = d.sQLSelect("select StudentName from " +
winselectClass.popClassTables.text)

  u = dcurs.FieldCount
  me.deleteAllRows
  while not dcurs.eof
    for i = 1 to u
      fld =dcurs.idxfield(i)
      me.AddRow fld.StringValue
    next
    dcurs.movenext
  wend
  d.Close

I don't know if this was the most efficient way, but after hours of
tinkering, this is all that worked. Unfortunately, my next problem is
that I want to select the data and set the captions of an array of
bevelbuttons with the values. I'm trying this:

  dcurs = d.sqlselect("select Subjects from "
+winSelectClass.popClassTables.text)

  u = dcurs.FieldCount

  while not dcurs.eof

    for i = 1 to u
      fld =dcurs.idxfield(i)
      bevelbutton1(i).Caption = fld.StringValue
      bevelbutton1(i).visible = true
      dcurs.Movenext
    next

  wend

  d.Close

but it is only setting the caption of the first button (I've tried
making all buttons visible by default but still only the first has a
caption). Once again pulling out hair.

  Nelson

Quote:
> If I understand your question, what you need to do is use a string
> property in your other woindow and pass the sql to it.

> so in window one, in the change event of the popup:

> window2.sqlproperty = "SELECT StudentName FROM " + popupmenu1.text

> then in window2, use that property as your query.

> Does that help



Mon, 23 Aug 2004 05:34:33 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. URGENT: need help with binding external process!

2. URGENT-help needed-URGENT

3. URGENT: Need help with AND binary operation in awk

4. Need Help on awk!!!! **** Urgent ****

5. 2nd post Urgent: Need help with FM2.9!

6. urgent help needed

7. clarion 5.5 urgent help needed

8. Help needed... URGENT

9. *URGENT* Help need with data export

10. Urgent-Need help with batch update

11. Urgent help needed about Clarion 4

12. Need urgent help!!!

 

 
Powered by phpBB® Forum Software