Jump to content

ADO and ASP help needed

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
alvintafoya

alvintafoya

    Newbie

  • Members
  • Pip
  • 1 posts
I am fairly new to Web programming and I need some help.
The following code snippet came from a page I wrote. The records are written to the database (SQL Server 2000) but the page never comes up after this point. I have narrowed the problem down to this loop, but I have no idea where to go from here.
SQLStmt="insert into tbl_wss_transpers (fld_ssn,fld_name,fld_adminuic,fld_hirestatus,fld_ ntlogon,fld_subscriptiondate,"
SQLStmt=SQLStmt & "fld_updatedate,fld_source,fld_approved,fld_locked ,fld_update,fld_password) "
SQLStmt=SQLStmt & "values('" & SSN & "','" & NAME & "','" & UIC & "','" & HIRE & "','" & EMAIL & "','" & DTESUB & "',"
SQLStmt=SQLStmt & "'" & DTEUPDT & "','" & SOURCE & "',0,0,0,'" & PASS & "')"
connection.BeginTrans
connection.Execute(SQLStmt)
connection.CommitTrans


set rsName=Server.CreateObject("adodb.recordset")
SQLStmt="select * from tbl_wss_services where fld_active=1 and fld_dpiadmin=0 order by fld_serviceid"
rsName.open SQLStmt,conn
rsName.MoveFirst
While not rsName.EOF
SERVID=rsName("fld_serviceid")
SERVNAME=rsName("fld_servicename")
If Request.Form(SERVID)= "Yes" then
strSQL="insert into tbl_wss_transservice(fld_ssn,fld_serviceid,fld_ser vicename) "
strSQL=strSQL & "values('" & SSN & "','" & SERVID & "','" & SERVNAME & "')"
connection.BeginTrans
connection.Execute(strSQL)
connection.CommitTrans
End If

rsName.Movenext
Wend
rsName.close
Like I said, the records actually make it to the database. The HTML portion of the page displays the records just written, but page execution stops after the above loop. Also the page takes an inordinate amount of time to load.
Any help would be greatly appreciated.

Thanks

Edited by WingedPanther, 05 June 2008 - 12:48 PM.
add code tags


#2
lartzi

lartzi

    Newbie

  • Members
  • Pip
  • 4 posts
Why you don't use the "Stop" keyword and debug it and see exactly what is the problem?

#3
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
Welcome to Code Call.

If your asking a question, you should use
 
tags to display your code, so it is easier to see.

Well I know nothing about ASP so I can't really help.

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,822 posts
Try changing your loop to a Do While
Do While not rsName.EOF
  SERVID=rsName("fld_serviceid")
  SERVNAME=rsName("fld_servicename")
  If Request.Form(SERVID)= "Yes" then
    strSQL="insert into tbl_wss_transservice(fld_ssn,fld_serviceid,fld_ser vicename) "
    strSQL=strSQL & "values('" & SSN & "','" & SERVID & "','" & SERVNAME & "')"
    connection.BeginTrans
    connection.Execute(strSQL)
    connection.CommitTrans
  End If

  rsName.Movenext
Loop

Edited by WingedPanther, 05 June 2008 - 12:51 PM.
format code

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog