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!

Hi if you can't tell i am new at SQL. I am not able to delete the lin

Status
Not open for further replies.

majohnson

Technical User
Jun 28, 2000
6
US
Hi if you can't tell i am new at SQL.&nbsp;&nbsp;I am not able to delete the link from the database.&nbsp;&nbsp;My page says i am successful but it still there.&nbsp;&nbsp;What do you suggest?<br><br><br>oConn.Open<br>SQL = &quot;DELETE FROM EPIC_LINK WHERE LNK_USER = &quot; & UserID & &quot; and LNK_NM = '&quot; & name & &quot;'&quot;<br>Response.Write SQL<br>oConn.Execute(SQL)<br>%&gt;<br><br>DELETE FROM EPIC_LINK WHERE LNK_USER = '' and LNK_NM = '' <br><br>
 
Dear majohnson,<br><br>&gt; DELETE FROM EPIC_LINK WHERE LNK_USER = '' and LNK_NM = '' <br><br>If that is the contents of your variable named SQL you should copy that statement into your database's IDE and execute it there to verify that it produces your desired result.<br><br>-pete<br><br>
 
is this line what you code prints on the WEB page?<br>DELETE FROM EPIC_LINK WHERE LNK_USER = '' and LNK_USER = '' <br><br>then it appears that &quot;LNK_USER&quot; and &quot;LNK_USER&quot; are both blank. See nothing is inside the single quotes.<br><br>It should show something like this:<br>DELETE FROM EPIC_LINK WHERE LNK_USER = 'someone' and LNK_USER = 'somename' <br>See in you code you are Writing a response of the SQL string and its telling you that &quot;LNK_USER&quot; and &quot;LNK_USER&quot; are empty<br>OK<br>Then it's executing the statement aftet you are printing just the string.<br>the oConn.execute is passing nothing to be deleted<br>So it appears the where ever you are getting &quot;UserID&quot; and the &quot;name&quot; variables that they are not getiing passed to them.<br>Where are the 'UserID' and 'name' coming from. That's your problem, when you get to the SQL statement they are blank or empty, so it's not deleting anything at all.<br><br>OK<br><br><br><br><br><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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top