Solved

ASP calculation error

Posted on 2004-08-29
8
202 Views
Last Modified: 2012-05-05
Hi guys,

I have a serious problem here , i run a site that process results base on a set of data , the problem is before i process i have ability to FORECAST the result without making changes to DB , but SOMETIMES when after i do processing the results do not match the forecast results

this discrepancies results in much inconvience and also wrong data presented to my clients , i have to undo the process and reprocess again then i will get the same result as the forecast.

this is a headache , the site is quite busy and the only conclusion i can think of is that when some of the client is accessing the site i was processing the data thus resulting in the discrepancies

do any of you guys have any solution or method to resolve this issue ?

regards
0
Comment
Question by:weeee
8 Comments
 
LVL 84

Assisted Solution

by:ozo
ozo earned 200 total points
ID: 11927767
How about locking the data accesses so that only one person can process the data at any one time?
0
 

Author Comment

by:weeee
ID: 11927824
hi ozo ,

how do i do that ? because i am not the developer , and therefore i need to ask my programmer to work this out , care to tell me what should i tell him so he can work on it?

regards
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 11928308
You just change the locktype on the connection with the database.
If he knows any ASP he'll know his locktypes....

0
 

Author Comment

by:weeee
ID: 11929178
ok thks guys will ask him to test this method
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:weeee
ID: 11931841
hi ozo and oilwarner

my programmer asked my to ask you guys what locktype connection do you recomend

thanks
0
 
LVL 5

Expert Comment

by:prashantagarw10
ID: 11936527
I feel ozo would suggest adLockOptimistic for this. u may go ahead and try.
0
 
LVL 16

Accepted Solution

by:
OliWarner earned 300 total points
ID: 11941180
No, no no no no...

Optimistic allow people to play with the data until you've called the update()... which isnt very helpful here...


You want to use adLockPessimistic because that locks the data until it is updated or the connection is broken/finished.

If your programmer want to read up on the differences between the locktypes send him here: http://www.blueclaw-db.com/asp_ado_connection_string/
0
 

Author Comment

by:weeee
ID: 11946925
What about adLockReadOnly?
Small example:

sqlString="select * from table1"
set rs=myDB.execute(sqlString)
do while not rs.eof
   sqlString="select * from table2"
   set rs1=myDB.execute(sqlString)
   ..... calculation using table1,table2.......
   sqlString="update table3 set ......."
   set rs1=myDB.execute(sqlString)
rs.movenext
loop

Is it possible to lock database during do while ... loop?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Fibonacci challenge 11 111
VB 6.0 printer how to align 6 58
Is it possible to programatically fill out a fillable ADOBE PDF form? 9 78
Regular Expression Calculator Tester 2 59
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now