473,387 Members | 1,549 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,387 software developers and data experts.

I have error of update code in asp program

I have error in update code. It work but i not found data in Microsoft Access.
This is the code.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body><br><br><br><br><br><br><br><br>
  3. <h1><center>Appointment Update
  4. <hr>
  5. <% 
  6. dim AppointmentID
  7. dim ChildID
  8. dim VisitID
  9. dim StaffID
  10. dim DateOfAppointment
  11. dim Time
  12. dim Remarks
  13. AppointmentID=request.form("AppointmentID")
  14. Response.write(AppointmentID)
  15. ChildID=request.form("ChildID")
  16. VisitID=request.form("VisitID")
  17. StaffID=request.form("StaffID")
  18. DateOfAppointment=request.form("DateOfAppointment")
  19. Time=request.form("Time")
  20. Remarks=request.form("Remarks")
  21. sql="update Appointment set ChildID='"&ChildID&"',VisitID='"&VisitID&"',StaffID='"&StaffID&"',DateOfAppointment='"&DateOfAppointment&"',Time='"&Time&"',Remarks='"&Remarks&"' where AppointmentID='"&AppointmentID&"'"
  22. //response.write sql
  23. set Conn=Server.CreateObject("ADODB.Connection")
  24. Conn.open "C"
  25. set rs=Server.CreateObject("ADODB.recordset")
  26. response.write("update data")
  27. %>
  28. ID of child is Updated
  29.  
  30. <form  method ="POST"action="medicals.asp">
  31. <input type=Submit value="Back">
  32. </form>
  33. </body>
  34. </html>
Please help me.
Dec 29 '10 #1
3 2189
jhardman
3,406 Expert 2GB
So this doesn't give an error? I can think of several reasons that it would fail to update, but they should all give an error.

Try outputting just your update statement (response.write sql) and run it in access's query analyzer? Does it work from there?

Jared
Dec 29 '10 #2
Hi.
Thanks for reply my message. I edit the code but I face new error. The error is Update Statement.
This is the code.
<html>
<body><br><br><br><br><br><br><br><br>
<h1><center>Appointment Update
<hr>
<%
dim AppointmentID
dim ChildID
dim VisitID
dim StaffID
dim DateOfAppointment
dim Time
dim Remarks
AppointmentID=request.form("AppointmentID")
Response.write(AppointmentID)
ChildID=request.form("ChildID")
VisitID=request.form("VisitID")
StaffID=request.form("StaffID")
DateOfAppointment=request.form("DateOfAppointment" )
Time=request.form("Time")
Remarks=request.form("Remarks")
set conn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "update Appointment set ChildID='"&ChildID&"',VisitID='"&VisitID&"',StaffI D='"&StaffID&"',DateOfAppointment='"&DateOfAppoint ment&"',Time='"&Time&"',Remarks='"&Remarks&"' where AppointmentID='"&AppointmentID&"'","DSN=C"

%>
ID of child is Updated

<form method ="POST"action="medicals.asp">
<input type=Submit value="Back">
</form>
</body>
</html>
Dec 31 '10 #3
jhardman
3,406 Expert 2GB
1- print out your update statement (use response.write and the exact code you are trying to send to the db)
2- try that update statement in a query analyzer

I suspect the problem is you are posting text when you should be posting a number
Expand|Select|Wrap|Line Numbers
  1. childID='219' //this will probably give an error
  2. childID=219. //this is probably right
The next time you post you must say that you printed out the sql statement and tested it in access or I will not answer. Also note that your code should be in code tags (use the button marked #).

Jared
Dec 31 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sql-db2-dba | last post by:
CLI connection failed. SQL0902C. A system error (reason code="6029321") occurred. Subsequent SQL statements cannot be processed. SQLSTATE=58005. Has anyone encountered the above error? We are...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
1
by: David | last post by:
Hi, I am trying to a field in a Access database, and I have used the code generated by the Web Matrix UPDATE code wizard. When the update function is called, no errors are generated, but no...
3
by: JPARKER | last post by:
Our DB2 8.2 FixPak9 database running on Win2K crashed with after reporting this message SQL0902C A system error (reason code = 9") ocurred I have searched the DB2 documentation as well as the...
3
by: Mark | last post by:
I'm just starting out in an introductory ASP.Net course, and am trying to run a simple program but keeping getting an error. "http://localhost/day1/listing0104.aspx" is placed in the address line...
1
by: Chris Wheeler | last post by:
I'm having what seems to be a rather strange error. The VB program interacts with an Access Database with ODBC connection to a DB2 database, but doesn't really do anything too tricky (select...
3
by: Hul Tytus | last post by:
comp.infosystems.www.authoring.html error in c program for cgi When compiled and placed in the cgi directory, the code below generates a server (netbsd/apache) error. The directory & mintst.cgi...
1
by: gchris53 | last post by:
Hello, Any advice on the attached would be greatly appreciated. I am currently customising someone elses database and have the following problem. A date is updated on a form, in database...
2
by: globomike | last post by:
Hi, can anybody tell me what the reason code 18 means in combination with a SQL0902 error? It would be helpful to know details about the reason code but I could not find any details about that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.