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!

ASP and Flash Code 1

Status
Not open for further replies.

SHARKY99

Programmer
Oct 25, 2001
473
CA
Hi all here is my code:

Code:
Response.Write TabloOut(toind)= & Server.URLEncode(rsHorCou(Tablo(tind)))


but it has to be in this format:

Code:
Response.Write "NameFirst=" & Server.URLEncode(oRS("NameFirst"))

It's just that i have too many field to name'em one by one so i used Arrays... can u help????

Thanks in advance

Sharky99 >:):O>
 
Err .. not sure I understand that, but here's what I'm guessing you want.
(Assuming ADO recordset oRs,
array TabloOut,
integer tind) ..
(Also assuming VBS)

Response.Write oRs.Fields(TabloOut(tind)).Name & "=" & Server.URLEncode(oRs.Fields(TabloOut(tind)).Value)

or if TabloOut contains more meaningful names than the table field names

Response.Write TabloOut(tind) & "=" & Server.URLEncode(oRs.Fields(TabloOut(tind)).Value)

<insert witticism here>
codestorm
 
Ok thanks i'll try it right away...if it doesn't work i'll post the entire code.

Sharky99 >:):O>
 
It doesn't work...X-)

Here is the entire code

Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
dim OyDate, DayNo, Tablo, TabloOut, StartMyDate, StopMyDate, DayNoTemp, tind, dbReserv, rsHorCou, Vsql, dayofweek, takeoffweek, toind, AllWeek, awind, DaybyDay
Tablo=Array(&quot;8h00&quot;,&quot;8h30&quot;,&quot;9h00&quot;,&quot;9h30&quot;,&quot;10h00&quot;,&quot;10h30&quot;,&quot;11h00&quot;,&quot;11h30&quot;,&quot;12h00&quot;,&quot;12h30&quot;,&quot;13h00&quot;,&quot;13h30&quot;,&quot;14h00&quot;,&quot;14h30&quot;,&quot;15h00&quot;,&quot;15h30&quot;,&quot;16h00&quot;,&quot;16h30&quot;,&quot;17h00&quot;,&quot;17h30&quot;,&quot;18h00&quot;,&quot;18h30&quot;,&quot;19h00&quot;,&quot;19h30&quot;,&quot;20h00&quot;,&quot;20h30&quot;,&quot;21h00&quot;,&quot;21h30&quot;,&quot;22h00&quot;,&quot;22h30&quot;)

TabloOut=Array(&quot;flSun&quot;,&quot;flMon&quot;,&quot;flTue&quot;,&quot;flWed&quot;,&quot;flThu&quot;,&quot;flFri&quot;,&quot;flSat&quot;)

OyDate = DATE
dayofweek=weekday(OyDate)
takeoffweek=dayofweek-1
StartMyDate = DateAdd(&quot;D&quot;, -takeoffweek, OyDate) 
StopMyDate = DateAdd(&quot;D&quot;, +6, StartMyDate)
DaybyDay=StartMyDate

set dbReserv= server.createObject(&quot;ADODB.Connection&quot;)
set rsHorCou=server.createObject(&quot;ADODB.Recordset&quot;)
dbReserv.open &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=&quot; & server.mappath(&quot;..&quot;) & &quot;/dbs/BDReservation.mdb&quot;
vSql=&quot;SELECT QryB1204.Date, QryB1204.[8h00], QryB1204.[8h30], QryB1204.[9h00], QryB1204.[9h30], QryB1204.[10h00], QryB1204.[10h30], QryB1204.[11h00], QryB1204.[11h30], QryB1204.[12h00], QryB1204.[12h30], QryB1204.[13h00], QryB1204.[13h30], QryB1204.[14h00], QryB1204.[14h30], QryB1204.[15h00], QryB1204.[15h30], QryB1204.[16h00], QryB1204.[16h30], QryB1204.[17h00], QryB1204.[17h30], QryB1204.[18h00], QryB1204.[18h30], QryB1204.[19h00], QryB1204.[19h30], QryB1204.[20h00], QryB1204.[20h30], QryB1204.[21h00], QryB1204.[21h30], QryB1204.[22h00], QryB1204.[22h30] FROM QryB1204 WHERE (((QryB1204.Date)>=#&quot; &  StartMyDate & &quot;# And (QryB1204.Date)<=#&quot; & StopMyDate & &quot;#)) ORDER BY QryB1204.Date;&quot;
rsHorCou.open vSql,dbReserv,1,2,1

toind = 0
while not rsHorCou.EOF


while DayByDay <> rsHorCou(&quot;Date&quot;)
DaybyDay=DateAdd(&quot;D&quot;, +1, DaybyDay)
toind=toind+1
wend

for tind = 0 to ubound(Tablo)
Response.Write &quot;TabloOut(toind)=&quot; & Server.URLEncode(rsHorCou(Tablo(tind)))     ' here is my problem****************_____
next

toind=toind+1
DaybyDay=DateAdd(&quot;D&quot;, +1, DaybyDay)
rsHorCou.MoveNext
wend

%>

The line where my problem is should be(according to an example i've got) in this format.

Response.Write &quot;NameFirst=&quot; & Server.URLEncode(oRS(&quot;NameFirst&quot;))

So i'm replacing &quot;NameFirst&quot; (FLASH dynamic text field name) with &quot;flSun&quot; which is in an array and the database field name is in an array too.(named 8h00)...

Anybody i really need this A.S.A.P Thanks in advance...

Sharky99 >:):O>
 
I think the problem might be :

for tind = 0 to ubound(Tablo)
Response.Write &quot;TabloOut(toind)=&quot; & Server.URLEncode(rsHorCou(Tablo(tind)))
next


when it should be :


for tind = 0 to ubound(Tablo)
Response.Write TabloOut(toind) & &quot;=&quot; & Server.URLEncode(rsHorCou(Tablo(tind)))
next Regards

Big Dave


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Thanks BigDave if it works you'll see STARS...LOL

Sharky99 >:):O>
 
WE HAVE ANOTHER BIG BIG WINNER

THANX BIG DAVE IT WORKED...:-V


Sharky99 >:):O>

 
To be honest it finally didn't work???

I ended up sending all my datas in one string...

Don't know why but i can't use loops when sending data to flash??

Anyway i'm done with the job, so...

Thanks again guys


Have Fun...

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top