di_2006 Level: Protégé
 Registered: 03-03-2006 Posts: 4
|
vb6.exe-Application error??
I am doing a project with VB6.0 as the front-end and Access 2003 as the back-end.
I have a database by the name "taxi" & a table by the name "taxi_details".Following is the code to update an entry in the database.
con.Open App.Path & "\Taxi.mdb"
sql2 = "update taxi_details set person='" & Text3.Text & "'"
sql2 = sql2 & ",depart='" & Text4.Text & "',purpose='" & Text5.Text & "', amount='" & Text6.Text & "',kilometres='" & Text7.Text & "' where taxi_no='" & Form2.Text1.Text & "' and date=#" & Form2.Text2.Text & "#"
rs.Open sql2, con, adOpenDynamic, adLockOptimistic
con.Execute sql2, rs
After running the code, the particular entry gets updated but I get a "vb6.exe-Application Error"saying-
The instruction at "0x...." referenced memory at "0x00000000".The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program.
and my VB application gets terminated. I am facing the same problem while adding a new entry to the database too.Following is the code to add a new entry:
sql1 = "insert into taxi_details values('" & Text1.Text & "',#" & Text2.Text & "#,'" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "')"
con.Execute sql1, rs
I am really confused with this particular problem and I donot understand whats the cause.
PLEASE HELP!
I can attach the entire project, if anyone wants to see the whole code..
Please let me know.Thanks in advance!
|