Error trying to close EDS database
- Posted by ronaustin at alltel.net Oct 14, 2003
- 518 views
--------------Boundary-00=_E8CQQL80000000000000 charset="iso-8859-1" The following program allows me to add one record and then blows up when = I try to add a second record. It says I should look in ex.err, which is a = 57K file that I don't understand. Does anyone see any obvious problems with this program as far as I have got with it?=0D =0D As you can see, I have not done any error trapping yet, and I have got to come up with a way to get, display and edit a record, but first I am just trying to write out a record.=0D =0D I used the edb.exw program to look at the database and there is one recor= d saved in the Diagnosis table.=0D =0D -- eyediag.exw=0D -- Diagnosis Code Maintenance=0D =0D include win32lib.ew=0D include database.e=0D without warning=0D integer err=0D =0D constant=0D Win =3D create( Window, "Diagnosis Code Maintenance", 0, Center, Center,350,200,0),=0D =0D Lbl1 =3D create(LText,"Code",Win,20,30,60,20,0),=0D Code =3D create(SleText,"",Win,80,30,42,20,0),=0D Lbl2 =3D create(LText,"Description",Win,20,80,60,20,0),=0D Desc =3D create(SleText,"",Win,80,80,248,20,0),=0D =0D =0D Save_Rec =3D create(PushButton, "Save",Win,25,130,80,20,0),=0D Delete_Pat =3D create(PushButton, "Delete",Win,250,130,80,20,0)=0D =0D =0D =0D -- run code=0D err=3D db_create("Eye-Comp", DB_LOCK_NO)=0D =0D setWindowBackColor(Win,rgb(0,255,127))=0D setFocus(Code)=0D =0D procedure Save_Diag(integer self, integer event,sequence parms)=0D err =3D db_open("Eye-Comp",DB_LOCK_NO)=0D err =3D db_create_table("Diagnosis")=0D err =3D db_insert(getText(Code),getText(Desc))=0D db_close()=0D end procedure=0D =0D setHandler(Save_Rec,w32HClick,routine_id("Save_Diag"))=0D =0D =0D WinMain( Win, Normal) =0D =20 --------------Boundary-00=_E8CQQL80000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-= 1"> <META content=3D"IncrediMail 1.0" name=3DGENERATOR> <!--IncrdiXMLRemarkStart> <IncrdiX-Info> <X-FID>FLAVOR00-NONE-0000-0000-000000000000</X-FID> <X-FVER></X-FVER> <X-CNT>;</X-CNT> </IncrdiX-Info> <IncrdiXMLRemarkEnd--> </HEAD> <BODY style=3D"BACKGROUND-POSITION: 0px 0px; SCROLLBAR-FACE-COLOR: #ebeae= a; FONT-SIZE: 12pt; MARGIN: 5px 10px 10px; SCROLLBAR-HIGHLIGHT-COLOR: #ae= aaaa; SCROLLBAR-SHADOW-COLOR: #a9a7a7; SCROLLBAR-3DLIGHT-COLOR: #e5e5e5; = SCROLLBAR-ARROW-COLOR: #875b38; FONT-FAMILY: Arial; SCROLLBAR-DARKSHADOW-= COLOR: #545252" bgColor=3D#ffffff background=3D"" scroll=3Dyes ORGYPOS=3D= "0" X-FVER=3D"3.0"> <TABLE id=3DINCREDIMAINTABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100= %" border=3D0> <TBODY> <TR> <TD id=3DINCREDITEXTREGION style=3D"FONT-SIZE: 12pt; CURSOR: auto; FONT-F= AMILY: Arial" width=3D"100%"> <DIV>The following program allows me to add one record and then blows up = when I try to add a second record. It says I should look in ex.err,= which is a 57K file that I don't understand. Does anyone see any o= bvious problems with this program as far as I have got with it?</DIV> <DIV> </DIV> <DIV>As you can see, I have not done any error trapping yet, and I have g= ot to come up with a way to get, display and edit a record, but first I a= m just trying to write out a record.</DIV> <DIV> </DIV> <DIV>I used the edb.exw program to look at the database and there is one = record saved in the Diagnosis table.</DIV> <DIV> </DIV> <DIV> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt; tab-stops: 63.0pt">= <SPAN style=3D"mso-fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT= face=3D"Courier New">-- eyediag.exw<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">-- Diagnosis Code Maintenance<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"> <o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">include win32lib.ew<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">include database.e<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">without warning<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">integer err</FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"> <o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">constant<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Win<SPAN s= tyle=3D"mso-spacerun: yes"> </SPAN>=3D<SPAN style= =3D"mso-spacerun: yes"> </SPAN>create( Window, "Diagnosis Code Main= tenance", 0, Center, Center,350,200,0),<o:p></o:p></FONT></FONT></SPAN></= P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> = &= nbsp; </SPAN><SPAN style=3D"mso-spacerun: yes"> </= SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Lbl1 =3D c= reate(LText,"Code",Win,20,30,60,20,0),<o:p></o:p></FONT></FONT></SPAN></P= > <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Code =3D c= reate(SleText,"",Win,80,30,42,20,0),<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Lbl2 =3D c= reate(LText,"Description",Win,20,80,60,20,0),<o:p></o:p></FONT></FONT></S= PAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Desc =3D c= reate(SleText,"",Win,80,80,248,20,0),<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p= ></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p= ></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Save_Rec =3D= create(PushButton, "Save",Win,25,130,80,20,0),<o:p></o:p></FONT></FONT><= /SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Delete_Pat= =3D create(PushButton, "Delete",Win,250,130,80,20,0)<o:p></o:p></FONT></= FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p= ></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p= ></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-tab-count: 1"> </SPAN= ><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p><= /FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">-- run code<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>err=3D db_create= ("Eye-Comp", DB_LOCK_NO)<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p></FON= T></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>setWindowBackCol= or(Win,rgb(0,255,127))<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>setFocus(Code)<o= :p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p></FON= T></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN styl= e=3D"mso-spacerun: yes"> </SPAN>procedure Save_Diag(integer self, in= teger event,sequence parms)<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN style=3D"mso-tab= -count: 1"> </SPAN><SPAN style=3D"mso-spacerun: yes">&n= bsp; </SPAN>err =3D db_open("Eye-Comp",DB_LOCK_NO)= <o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN style=3D"mso-tab= -count: 1"> </SPAN><SPAN style=3D"mso-spacerun: yes">&n= bsp; </SPAN>err =3D db_create_table("Diagnosis")<o= :p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN style=3D"mso-tab= -count: 1"> </SPAN><SPAN style=3D"mso-spacerun: yes">&n= bsp; </SPAN>err =3D db_insert(getText(Code),getTex= t(Desc))<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN style=3D"mso-tab= -count: 1"> </SPAN><SPAN style=3D"mso-spacerun: yes">&n= bsp; </SPAN>db_close()<o:p></o:p></FONT></FONT></S= PAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN>end = procedure<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-tab-count: 1"> </SPAN= ><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p></FONT>= </FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><SPAN style=3D"mso-spac= erun: yes"> </SPAN>setHandler(Save_Rec,w32HClick,routine_id("= Save_Diag"))<o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p></FONT></FO= NT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w"><SPAN style=3D"mso-spacerun: yes"> </SPAN><o:p></o:p></FON= T></FONT></SPAN></P> <P class=3DMsoPlainText style=3D"MARGIN: 0in 0in 0pt"><SPAN style=3D"mso-= fareast-font-family: 'MS Mincho'"><FONT size=3D2><FONT face=3D"Courier Ne= w">WinMain( Win, Normal) <o:p></o:p></FONT></FONT></SPAN></P></DIV> <DIV> </DIV></TD></TR> <TR> <TD id=3DINCREDIFOOTER width=3D"100%"> <TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%"> <TBODY> <TR> <TD width=3D"100%"></TD> <TD id=3DINCREDISOUND vAlign=3Dbottom align=3Dmiddle></TD> <TD id=3DINCREDIANIM vAlign=3Dbottom align=3Dmiddle></TD></TR></TBODY></T= --------------Boundary-00=_E8CQQL80000000000000--