Please help

Results 1 to 3 of 3

Thread: Please help

  1. #1
    Join Date
    Dec 1969
    Posts
    760

    Default Please help

    I&#039m writing some ASP code using perlscript however I have a problem. I can access a database (through an SQL query) and get<BR>a result. However I have a question regarding that result. When<BR>I try to access the fields of that "subtable" such as:<BR><BR>$subtable = $db->Execute("some SQL query");<BR>$x = $subtable->Fields("index");<BR><BR>Now if I try to access try to place $x as an argument to a function such as &function($x), I don&#039t get a valid result. However if I do something like this (HTML code):<BR><BR>&#060;hr>&#060;% = $x &#037;&#062;&#060;hr><BR><BR>This returns the correct value. So I know $x is holding the value I want. But how do I pass that value to a function?

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Please help

    This is a long shot, but try this (and let me know if it works!!)<BR><BR>$x = $subtable->Fields("index")->Value;<BR><BR>(You may need a period between Fields("index") and Value, I&#039ve never used Perl and ADO. What I assume is in your example, is that it sets $x equal to the struct, if you will, that is Fields("index"). Fields("index") contains more than just the name of the field. It also has the DataSize, the column name, the datatype, the precision, etc., etc. Since you just want the value, use the .Value member of that "struct"

  3. #3
    Join Date
    Dec 1969
    Posts
    760

    Default RE: Please help

    Thanks Scott. That did it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •