473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

ASP CODE IS STOPPING THE IIS SERVICE DEAD

Im running some pretty straight forward code.

Mainly database access (SQL7) doing inserts and sometimes when the script
runs it halts the IIS service dead in its tracks. Before the page can even
finish loading.

the error seems to be caused when i introduced this section of code into the
page.

sub SaveIDC( rec2Save )

'# Local variable declarations
Dim myLocalArr
Dim szIDCID
Dim szIndividualID
Dim rsQJIndInfo

'# Perform the value extractions from the CSV record.
myLocalArr = breakString( rec2save, "SR" )

'# get the individual id from the QJIndInfo table based on the QJ User ID.
set rsQJIndInfo = server.CreateObject("ADODB.Recordset")
rsQJIndInfo.Open "select * from QJIndInfo where QJUserID = '" &
myLocalArr(12) & "'", conn, 1, 3

if rsQJIndInfo.RecordCount > 0 then
szIndividualID = rsQJIndInfo("Individual_ID")
else
szIndividualID = myLocalArr(12)
end if

szIDCID = replace(myLocalArr(64), " ", "" ) & "_" & myLocalArr(12) & "-" &
myLocalArr(13) & "_" & formatdatetime(now(),2)& formatdatetime(now(),3)

'# Insert the ID card
Response.Write " <li>Inserting ID Card " & myLocalArr(12) & "...<br>"
Conn.execute "insert into IDC (IDC_ID, CardNumber, Type, DateIssued,
IssuingNLC, ExpiryDate, CreationEditDate, IsQwizz ) values ('" & szIDCID &
"','" & replace(myLocalArr(64), " ", "" ) & "','PIDC','" & REPLACE(
myLocalArr(65), "-", "/" ) & "','0000','','" & formatdatetime(now(),2) &
"',-1 )"

'# Create the Ind_tic_idc record with null ticket ref
Conn.execute "insert into Ind_Tic_IDC ( Individual_ID, Ticket_ID, IDC_ID )
values ('" & szIndividualID & "','NULL','" & szIDCID & "')"

'# Create the Ind_tic_idc record with ticket ref
Conn.execute "insert into Ind_Tic_IDC ( Individual_ID, Ticket_ID, IDC_ID )
values ('" & szIndividualID & "','" & szGlobalTic_ID & "','" & szIDCID &
"')"

'Update Audit Trail
conn.execute "insert into AuditTrail
(User_ID,NLC_ID,Operation,CreationEditDate) values ('QJ_USER','Q" &
myLocalArr(13) & "','Create IDCARD " & szIDCID & "','" & formatdatetime(
now(), 2 ) & " " & formatdatetime( now(), 3 ) & "')"

end sub

As you can see, pretty straight forward.
It seems to stop the service about 50% of the time its run.
Can anyone shed any light.

Thanks
Stewert
Jul 19 '05 #1
1 1734
"stewert gallington" <st*****@iqmarketing.org.uk> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Im running some pretty straight forward code.

Mainly database access (SQL7) doing inserts and sometimes when the script
runs it halts the IIS service dead in its tracks. Before the page can even
finish loading.

the error seems to be caused when i introduced this section of code into the page.


Your code is very vulnarable...
Avoid creating strings and executing them on SQL without filtering on the
string.
I prefer to use the ADODB.Command to execute inserts and to have a
ADODB.Parameter to filter arguments.

This might not solve your 'hang' problem but it could be caused by it. Also
check for recursive loops or for loops that do not end.
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
0
by: Daniel O'Brien | last post by:
Hi - any help with this would be greatly appreicated - it has already had me confused for a good few hours! I am using Visual Studio 2003 and the .NET framework 1.1. I have a C# Windows...
4
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group :...
20
by: Moty Michaely | last post by:
Hello, Can anyone please help me finding a good way to develop a c# winforms application client for a pre-developed windows service? Should I use wse2 with tcp protocol? Bu I still have win98...
7
by: Gene | last post by:
I have a Windows Service (VB.NET) that runs 24/7. It queries a Web service 5 to 10 times per hour. About 2 or 3 times a month, it fails. The log indicates that it sends the request to the Web...
0
by: Glen Wolinsky | last post by:
I am creating a Windows service that will check a request queue (database) for pending requests. It will then process each individual request until completed, wait a set time interval and then...
2
by: matteo | last post by:
Hi everyboby, i wrote a c# service that every XXX minute launch a working thread on timer events, something like this: private void timer_Elapsed ( object status ) { // Worker thread...
5
by: chris.hearson | last post by:
How do I programmatically prevent a service from stopping? I want to be able to keep my service running (started), under certain conditions, when a user tries to stop it. I have tried throwing an...
2
by: tshad | last post by:
I have a Service that starts a thread that never ends. When I stop the service from the Service Applet, does it kill the thread or do I need to do it myself? If it isn't killed, what happens...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.