# EXECUTE PROBLEM

Discussion in 'ASP General' started by Savas Ates, Jan 15, 2004.

1. ### Savas AtesGuest

only first query executed..

code is

Response.Write sayac & "<BR>"
for bul=0 to sayac-1
Response.Write bul & "<BR>"

sil="update [sheet3\$] set
urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
' where sesid='"&session.SessionID&"' and urunadi='"&delitema(bul)&"'"
response.write sil&"<br>"
baglantimiz.execute(sil)

next

output result is

4
0
update [sheet3\$] set
urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
' where sesid='891158220' and urunadi='LSZAW002W0'
1
update [sheet3\$] set
urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
' where sesid='891158220' and urunadi=' L300C-01AC'
2
update [sheet3\$] set
urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
' where sesid='891158220' and urunadi=' PRS-201'
3
update [sheet3\$] set
urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
' where sesid='891158220' and urunadi=' STR-400-1V'

still only first query executed. what is the problem...

Savas Ates, Jan 15, 2004

2. ### Ray atGuest

What makes you think that it isn't executing. If your code is what you have
below, it's executing. Do you have an On Error Resume Next anywhere?

Ray at work

"Savas Ates" <> wrote in message
news:...
> only first query executed..
>
> code is
>
> Response.Write sayac & "<BR>"
> for bul=0 to sayac-1
> Response.Write bul & "<BR>"
>
> sil="update [sheet3\$] set
>

urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
> ' where sesid='"&session.SessionID&"' and urunadi='"&delitema(bul)&"'"
> response.write sil&"<br>"
> baglantimiz.execute(sil)
>
> next
>
>
>
> output result is
>
> 4
> 0
> update [sheet3\$] set
>

urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
> ' where sesid='891158220' and urunadi='LSZAW002W0'
> 1
> update [sheet3\$] set
>

urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
> ' where sesid='891158220' and urunadi=' L300C-01AC'
> 2
> update [sheet3\$] set
>

urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
> ' where sesid='891158220' and urunadi=' PRS-201'
> 3
> update [sheet3\$] set
>

urunid='',sesid='',num='',marka='',modeladi='',fiyat='',tlfiyat='',urunadi='
> ' where sesid='891158220' and urunadi=' STR-400-1V'
>
>
> still only first query executed. what is the problem...
>
>

Ray at, Jan 15, 2004

3. ### Savas AtesGuest

only first query executed. others not.. first one is updated but other
queries not executed.. i m asking why?

Savas Ates, Jan 15, 2004
4. ### Ray atGuest

And I'm asking how know they aren't executed and if you have an on error
resume next statement.

For i = 1 to 10
response.write "x"
response.write "y"
Next

That's the basic layout of your code. You will ALWAYS see x and y both, not
just one of them.

Ray at work

"Savas Ates" <> wrote in message
news:...
> only first query executed. others not.. first one is updated but other
> queries not executed.. i m asking why?
>
>

Ray at, Jan 15, 2004
5. ### Savas AtesGuest

because im looking at my excell and seeing you only first record updated in
my lotf of queries... im running asp files and seeing the results of asp in
excell (my data stored here)...

Savas Ates, Jan 15, 2004
6. ### Ray atGuest

My guess is that the only update you're seeing is the ~last~ one, because
you do not have a WHERE clause in your sql statement. So, if you executed:

For i = 1 to 3
o.Execute "update [table] set [someColumn]=" & i
Next

It would first set them all to 1, then 2, and then 3. So you wouldn't see
any 1s or 2s ever.

Ray at work

"Savas Ates" <> wrote in message
news:...
> because im looking at my excell and seeing you only first record updated

in
> my lotf of queries... im running asp files and seeing the results of asp

in
> excell (my data stored here)...
>
>

Ray at, Jan 16, 2004

## Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.