Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Valid Script

Status
Not open for further replies.

Mun

Programmer
Mar 5, 2003
46
0
0
US
Is this a valid script?

<input type=&quot;text1&quot; name=&quot;text1&quot; value= &quot;<%=rs.fields(&quot;tbl_Name&quot;).value%>&quot;>

But it's giving me an error:

Error: Object doesn't support this property or method: 'fields'

Thanks.
 
Do you have your recordset object &quot;rs&quot; defined before trying to use it?

-Bad Dos
 
Should be

<input type=&quot;TEXT&quot; name..... Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Yes, Bad Dos! I do have recordset.
Sql = &quot;Select tbl_Name from tbl&quot;
rs = Conn.Execute(Sql)
 
Try taking off the .value at the end so it would read like this:

<input type=&quot;text1&quot; name=&quot;text1&quot; value= &quot;<%=rs.fields(&quot;tbl_Name&quot;)%>&quot;> Everything is absolute. Everything else is relative.
 
Try it like so...

<input type=&quot;text1&quot; name=&quot;text1&quot; value= &quot;<%=rs.fields.item(&quot;tbl_Name&quot;).value%>&quot;> Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Mun,

I think you need to change
rs = Conn.Execute(Sql)
to
Set rs = Conn.Execute(Sql)

You need the set in front because a recordset is an object.

Hope this helps,
Cathy
 
Mun,

I don't think you need Set statement for your recordset when you use Execute statement.

Try this
Sql = &quot;Select tbl_Name from tbl&quot;
rs = Conn.Execute(Sql)
<input type=&quot;text1&quot; name=&quot;text1&quot; value=&quot;<%=rs(&quot;tbl_Name&quot;)%>&quot;>


Thanks
Oysterbar ride to success. Keep Riding
 
cathyw is quite right - you need to use Set when assigning any object to a variable.

The result of conn.Execute will be a recordset, therefore you need the Set.

Code:
Sql = &quot;Select tbl_Name from tbl&quot;
Set rs = Conn.Execute(Sql)
...
<input type=&quot;text&quot; name=&quot;text1&quot; value=&quot;<%=rs(&quot;tbl_Name&quot;)%>&quot;>
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top