Strange OS related asp problem, need help

Results 1 to 3 of 3

Thread: Strange OS related asp problem, need help

  1. #1
    Join Date
    Dec 1969

    Default Strange OS related asp problem, need help

    I am developping an asp application using the platform win2000 professional.<BR><BR>In one of my asp page i have the following Code<BR><BR>Descripton of the code:<BR>When adding i am checking if that name already exists in the DB and if so i am poping up the message that name already existing.<BR>It is working perfectly in my win2000prof and i have tested in both in my localhost and ftp servers and in both places it is working as i ahve expected.<BR>But when the same application is opened in winxp i have a strange problem coming. When i add a new list , then it checks for the name and what happens is every time i add a new one and even if there is no matching record or matching name avialable for that record, javascript popups saying <BR>"Favourite List Name Already Exists" and the strangest part is the insert part also working. That is both if and else part are working together. I am getting this problem only in XP.<BR>What may be the probelm.<BR>I need help <BR>Thanks in advance<BR>with regards<BR>vimal<BR><BR><BR>set chk=server.CreateObject("ADODB.Recordset")<BR>chk. Open "select[ListName] from FavouriteList where[ListName]=&#039;" & trim(QFavName) & "&#039;",con<BR><BR><BR>if not chk.EOF then %&#062;<BR>&#060;script language="JavaScript" type="text/JavaScript"&#062;<BR>alert("Favourite List Name Already Exists");<BR>document.location.href="Dsp_FavAddOpt ion.asp?VedioPK=&#060;%= QRecIndex %&#062;";<BR>&#060;/script&#062;<BR><BR>&#060;%else<BR>set chk1=server.CreateObject("ADODB.Recordset")<BR>chk 1.Open "select max(List_PK) as FavPK from FavouriteList",con <BR>if isnull(chk1.Fields("FavPK")) then<BR>NewFavPK=1<BR>else<BR>NewFavPK= cint(chk1.Fields("FavPK"))+1<BR>end if<BR>AddFavName= "Insert into FavouriteList(List_PK,ListName,Description,DateCre ated,User_pk,CompetitionInde x) values(" & NewFavPK & ",&#039;" & Trim(QFavName) & "&#039;,&#039;" & trim(QDescription) & "&#039;,&#039;" & trim(QCreateDate) & "&#039;," & Session("UserID") & "," & cint(Session("CompetitionIndex")) & ")"<BR>&#039;Response.Write(AddFavName)<BR>con.Exe cute AddFavName, iResult<BR>AddItemToList="Insert into Favorite_list_index values(" & NewFavPK & "," & QRecIndex & "," & Session("UserID") & ",&#039;" & Trim(QFavItemDescription) & "&#039;,&#039;" & trim(QCreateDate) & "&#039;," & cint(Session("CompetitionIndex")) & ")"<BR>con.Execute AddItemToList, iResult<BR>set chk1=nothing<BR>end if <BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Bill's mantra: DEBUG, DEBUG, DEBUG

    &#060;%<BR>...<BR><BR>set chk=server.CreateObject("ADODB.Recordset")<BR><BR> SQL = "select[ListName] from FavouriteList where[ListName]=&#039;" & trim(QFavName) & "&#039;"<BR><BR>Response.Write "DEBUG SQL: " & SQL & "&#060;HR&#062;"<BR><BR>chk.Open SQL, con<BR><BR>Response.Write "After chk.Open, EOF is " & chk.EOF & "&#060;HR&#062;"<BR><BR>...<BR>%&#062;<BR><BR> What does that added debug tell you, if anything?<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Bill's pretty weir....

    hey - it&#039;s okay!<BR><BR>bill always says that it&#039;s not an advanced question - but then again, bill is quite an advanced guy and will probably never run his own business....<BR><BR>anyway let me know if you work this out or now. <BR><BR>best,<BR><BR>isac newton

Posting Permissions

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