javad0062
سه شنبه 19 اردیبهشت 1385, 13:04 عصر
سلام
من با پایگاه داده درasp ارتباط بر قرار کردم ولی وقتی یک فرم درست میکنم submitمیزنم یک اشکال از while آخر میگیره نمیدونم چرا
<!--#include file="datastore.asp" -->
<!--metadata type="typelib"
file="d:\program files\common files\system\ado\msado15.dll"-->
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
dim objcommand,objrs
set objcommand=server.createobject("adodb.command")
response.write"updating"
objcommand.activeconnection=strconnect
objcommand.commandtext="select *from employees"
objcommand.commandtype=adcmdtext
set objrs=objcommand.Execute
while not objrs.eof
response.write objrs("fname") &","&objrs("lname") &","&objrs("city") &"<br>"
objrs.movenext
wend
%>
<hr><br>
<%
objcommand.commandtext="insert into employees values('"+request.Form.Item("fname")+"','"+request.Form.Item("lname")+"','"+request.Form.Item("city")+"')"
objcommand.commandtype=adcmdtext
set objrs=objcommand.Execute
response.write"after inserting"&"<br>"
while not objrs.open
response.write objrs("fname")&","&objrs("lname")&","&objrs("city") &"<br>"
objrs.movenext
wend
set objcommand=nothing
set objrs=nothing
%>
</BODY>
</HTML>
من با پایگاه داده درasp ارتباط بر قرار کردم ولی وقتی یک فرم درست میکنم submitمیزنم یک اشکال از while آخر میگیره نمیدونم چرا
<!--#include file="datastore.asp" -->
<!--metadata type="typelib"
file="d:\program files\common files\system\ado\msado15.dll"-->
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
dim objcommand,objrs
set objcommand=server.createobject("adodb.command")
response.write"updating"
objcommand.activeconnection=strconnect
objcommand.commandtext="select *from employees"
objcommand.commandtype=adcmdtext
set objrs=objcommand.Execute
while not objrs.eof
response.write objrs("fname") &","&objrs("lname") &","&objrs("city") &"<br>"
objrs.movenext
wend
%>
<hr><br>
<%
objcommand.commandtext="insert into employees values('"+request.Form.Item("fname")+"','"+request.Form.Item("lname")+"','"+request.Form.Item("city")+"')"
objcommand.commandtype=adcmdtext
set objrs=objcommand.Execute
response.write"after inserting"&"<br>"
while not objrs.open
response.write objrs("fname")&","&objrs("lname")&","&objrs("city") &"<br>"
objrs.movenext
wend
set objcommand=nothing
set objrs=nothing
%>
</BODY>
</HTML>