I am querying a database and returning the records in a comma delimited format as the records will be is used later in a JavaScript. The records are being returned as:
("Record 1", "ID 1", "Record 2", "Record ID 2", );
I want to be able to ignore the last comma and space before closing the parentheses. Here is my code:
<%
Dim Text1, Text2
Text1 = "parent._ac_rpc(""KBAC"", "
Text2 = ");"
pm.SetConnection = "MyConnection"
pm.SetSource = "SELECT tblBooks.Book_ID, tblBooks.BookTitle, tblBooks.Active_Flag FROM tblBooks WHERE (tblBooks.BookTitle LIKE 'MyVariable') AND (tblBooks.Active_Flag = 'A')"
If (pm.InitRS = True) Then
Response.Write Text1
Do
(LINE 10) Response.Write """ & pm.GetItem("BookTitle") & """, """ & pm.GetItem("Book_ID") & """, "
pm.MoveNextItem
Loop Until pm.CurrentPageRowEnd
Response.Write Text2
Set pm = Nothing
End If
%>
I think the problem is with line 10.