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

what is wrong with the code?

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
I just copy the code from website for "Beginning Active Server Pages". It did not work. I have run other code access the database (movies2000.mdb), it works fine. Anybody knows what is wrong?

Thanks

Haijun

<%
Option Explicit
Dim strConnect
%>
<!-- #include file=&quot;DataStore.asp&quot; -->
<!-- METADATA TYPE=&quot;typelib&quot;
FILE=&quot;C:\Program Files\Common Files\System\ado\msado15.dll&quot; -->
<HTML>
<HEAD>
<TITLE>Using SQL's UPDATE Command and the ADO Command Object</TITLE>
</HEAD>
<BODY>
<%
Dim objComm, intNoOfRecords
Set objComm = Server.CreateObject(&quot;ADODB.Command&quot;)

Response.Write &quot;<B>Harry the Ham directs Tarantino films? </B><BR>&quot;
objComm.ActiveConnection = strConnect
objComm.CommandText=&quot;UPDATE AllMovies SET Director = 'Harry the Ham' &quot; & _
&quot;WHERE Director LIKE 'Quentin Tarantino'&quot;
objComm.CommandType=adCmdText
objComm.Execute intNoOfRecords
Response.Write &quot;This UPDATE command has affected &quot; & _
intNoOfRecords & &quot; records<BR><BR>&quot;

Response.Write &quot;<B>Tarantino returned to his rightful place as director:</B> <BR>&quot;
objComm.CommandText=&quot;UPDATE AllMovies SET Director = 'Quentin Tarantino' &quot; & _
&quot;WHERE Director LIKE 'Harry the Ham'&quot;
objComm.Execute intNoOfRecords
Response.Write &quot;This UPDATE command has affected &quot; & _
intNoOfRecords & &quot; records<BR><BR>&quot;
Set objComm = Nothing
%>
</BODY>
</HTML>
 
You also have the included file DataStore.asp??

Jordi Reineman
 
Dear Jordi:
Thank you for your quick response. I do have dataStore.asp file included in the same directory as this file.

Haijun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top