SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange Db Problem

    Hello i am having a strange DB problem

    <% do while not EvntRs.eof
    Dim x1, ClassName
    if x1 = 1 then
    ClassName="1"
    x1=2
    Else
    ClassName="2"
    x1=1
    End if

    Response.Write(Trim(EvntRs.fields("EventDescription")))
    Response.Write(Trim(EvntRs.fields("EventAttachmentPath")))
    Response.Write(Trim(EvntRs.fields("EventURL")))
    %>
    <tr>
    <td class="tblStyle<%= ClassName %>a"><%= FormatDateTime(Trim(EvntRs.fields("EventDate")),2) %>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><%= Trim(EvntRs.fields("EventSub")) %>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><%= Trim(EvntRs.fields("EventDescription")) %> &nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><%= Trim(EvntRs.fields("EventAttachmentPath")) %>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>c"><%= Trim(EvntRs.fields("EventURL")) %>&nbsp;</td>
    </tr>
    <% EvntRs.movenext
    Loop
    %>
    i am trying to put these data as a list. so i loop the database and put these into a list as shown. now the problem i am having is
    there is data for all these fields in the database.and but the last 3 fields are not appearing in the page.So i tried to put a response.write and those values were printed in the page and after putting response.write the values are appearing in the list and if remove that response.write those values are not apperaring.
    the description field is a ntext field and all others are nvarchar fields.

    the description field when i put resonse.write prints the data in the page but that is not appearing in the list.
    if somebody had expereienced this strage behaviour plz help me fix this problem
    with regards
    vimal
    Knowledge is all about Sharing

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when i used response.write directly in the list item still that values are not printed
    <tr>
    <td class="tblStyle<%= ClassName %>a"><%= FormatDateTime(Trim(EvntRs.fields("EventDate")),2) %>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><%= Trim(EvntRs.fields("EventSub")) %>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><%= Trim(EvntRs.fields("EventSub")) %> &nbsp;</td>
    <td class="tblStyle<%= ClassName %>b"><% Response.Write(Trim(EvntRs.fields("EventAttachmentPath")) )%>&nbsp;</td>
    <td class="tblStyle<%= ClassName %>c"><% Response.Write(Trim(EvntRs.fields("EventURL"))) %>&nbsp;</td>
    </tr>
    I have removed the ntext field description and tested and still the values are not printing.
    Knowledge is all about Sharing

  3. #3
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dig my head for 2 days and finally made it to work. Still i dont know the reason fro this problem, but i added a 1 after connnection string and it worked.
    rs.open"select * from tablename",con,1
    IF any expert could let me know why this happened and why it worked when i put 1 i would greatly appereciate that.
    with regards
    vimal
    Knowledge is all about Sharing

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to be honest I hardly ever use the conntypes ie. connection, 2, 2,

    But when creating a recordset I always tend to add , 2, 2 to the end and only once I have had an issue, where I had to use 2, 3

    Gav

  5. #5
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Roberts,
    Could you explain why you used 2,2 alwasy and what situation made you to use 2,3.
    I know little bit of visual basic and i add addlockoptimistic etc after the connection string but i dont understand why we add that and the purpose of each.
    If you could explain in simple terms about those connection parameters more than me lot of people like me will be benefitted.
    Thanks in advance and waiting for your reply in anxiety
    with regards
    vimal
    Knowledge is all about Sharing


Bookmarks

Posting Permissions

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