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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Web Page with VBScript and SQL

Status
Not open for further replies.

majohnson

Technical User
Jun 28, 2000
6
US
&lt;%UserID= &quot;'&quot; & Request.Form(&quot;UserID&quot;) & &quot;'&quot;<br>name=Request.Form(&quot;name&quot;)<br>%&gt;<br><br>SQL= &quot;SELECT LNK_NM, LNK_DSPL FROM EPIC_LINK WHERE LNK_USER = &quot; & UserID&nbsp;&nbsp;AND LNK_NM = &quot; & name<br><br>Can someone please tell me what is wrong with this SQL statement.&nbsp;&nbsp;I am trying to update the LNK_NM and LNK_DSPL.<br>Thanks<br>
 
Try this instead<br><br>&lt;%UserID= &quot;'&quot; & Trim(Request.Form(&quot;UserID&quot;)) & &quot;'&quot;%&gt;<br>&lt;%name=Trim(Request.Form(&quot;name&quot;))%&gt;<br><br>I put the trim statement in case there are trailing spaces<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
You have to surround text fields with quotes. I cant tell if UserID is text or numeric, so if its numeric, you dont need quotes, if its text you do.<br><br>SQL= &quot;SELECT LNK_NM, LNK_DSPL FROM EPIC_LINK WHERE LNK_USER = '&quot; & UserID&nbsp;&nbsp;&&nbsp;&nbsp;&quot;' AND LNK_NM = '&quot; & name & &quot;'&quot;<br><br>You might want to use a msgbox to display what the sql looks like... where lnk_user = 'jsmith' and lnk_mn = 'joe smith'<br><br>hth<br><br> <p> Ron<br><a href=mailto: > </a><br><a href= > </a><br>Independent Consultant<br>
Tampa Bay, Florida
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top