is it possible?

Results 1 to 3 of 3

Thread: is it possible?

  1. #1
    yobear Guest

    Default is it possible?

    i have an Access database with three fields: ID, Name, Email.<BR>i have 5 records in my table.<BR><BR>i send a query to the databse using ASP and ADO connectivity.<BR>i want ASP to return the resulting record set for my query<BR>in this format:<BR><BR>one long string representing all the values for the record set<BR>in this way:<BR><BR>record1=ID1&#124Name1&#124Email1&recor d2=ID2&#124Name2&#124Email2&record3=<BR>etc, upto the fifth record:<BR>&record5=ID5&#124Name5&#124Email5<BR><B R>i&#039;m not sure whether this can be done.<BR>any help from an asp guru would be appreciated.<BR><BR>thanx<BR>yobear

  2. #2
    Join Date
    Dec 1969

    Default Easy with VBS...

    &#060;%<BR>Set RS = yourConnectionToDB.Execute("SELECT * FROM table ORDER BY id")<BR>txt = ""<BR>rnum = 1<BR>delim = ""<BR>Do Until RS.EOF<BR>&nbsp; &nbsp; txt = txt & delim & "record" & rnum & "=" & RS("ID") _<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; & "&#124" & RS("Name") & "&#124" & RS("EMail")<BR>&nbsp; &nbsp; delim = "&"<BR>&nbsp; &nbsp; RS.MoveNext<BR>Loop<BR>Response.Write "What you wanted: " & txt<BR>%&#062;<BR><BR>That will do *all* records in the table, whether 1 or 100. If you really want to *be sure* to limit it to 5 you could change to<BR><BR>&#060;%<BR>Set RS = yourConnectionToDB.Execute("SELECT TOP 5 * FROM table ORDER BY id")<BR>...<BR>%&#062;<BR><BR><BR>

  3. #3
    yobear Guest

    Default RE: Easy with VBS...

    thanks bill!<BR><BR>seems exactly what i was looking for.<BR><BR>cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts