Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
A few days ago to write a program, accidentally encountered a strange problem.
Symptoms are described as follows:
The SQL Server service is installed on one of the Lenovo servers, and a stored procedure is written in one of its databases. This stored procedure takes a parameter that is judged by the statement in the argument and then executes the branch.
If @CustType =0
else if @CustType =1
The basic structure is this.
When I was developing, I used the program on my Laptop (Compaq) to connect to the server and the recordset in the ADO in the program. There is no problem when executing to rs.open. It is also OK to execute the call stored procedure with this program on the server.
But when you use the same program to access the other computers in that unit, when you run to the first situation in the stored procedure, all forms are automatically closed, and no exceptions appear.
There is a special situation, because the problem was previously on one of the Lenovo machines, then I went to see the problem and couldn't find out why. So I installed the VS6 on this computer, on-site debugging, but I debug everything normal, after one months, and then the original problem (form all closed)
That's a big problem. The same program is sometimes normal when it is executed on different computers, and I believe there is absolutely nothing wrong with the program. I think there may be a problem with the computer configuration. So when a computer redo, try again, still can't.
Think about whether the SP did not hit, and will be nearly two hours to install all the SPS. Still not normal. It is no use to install VS6 again. What is the problem? I think carefully, I have thought will be Lenovo's broken machine has a problem, will not be his CPU instructions wrong. (Because the machine is a bit older, it never happens on other computers). I tried to change the value of the first case in the program, which was 0 and changed to 3. So I changed the IF @CustType =0 in the stored procedure to if @CustType =3. The problem has arisen again. Whether the problem appears in this branch, the logic inside is certainly right. See the last line of code in this branch, which is used when debugging. To view the execution of a stored procedure, the loss of what statement is executed, that is, a print (@SqlStr), will not be caused by this statement. Comment it out. Open the program and try again. Passed on the computer of the knife.
It turns out that this problem is caused by the print statement. Blame it on some clients that do not have a problem when they do not report any exceptions, but automatically close the client form. It seems that you must pay attention to this problem when you write the program later. To clean up the debug code. I spent nearly a day in vain.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.