Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database problem..

Status
Not open for further replies.

thetambarineman

Technical User
Feb 29, 2000
63
0
0
GB
Hi everyone,<br><br>I'm hoping that someone can help me out here, once again!<br>The problem is: the app that i'm creating has database controls on it. I want to program some sort of functionality into the code which will autosave any entries that happen. I suppose that i could do it with the clock and every 3 mins update it-but my experience has been that it will crash. Also - i would like to be able to take a record and send it to the temp directory-just like word.<br><br>I realise that some of this is pretty heavy stuff but i would really appreciate any help that anyone can provide-<br>i'm stucko!!<br><br>Thanks in advance..<br><br>Paul McLornan..<br><br><br>
 
What do you mean 'autosave any entries'?&nbsp;&nbsp;If a record entry is made to the db, with a data control, it should save at that time, unless I'm misunderstanding the question. <br>--Jim
 
Thanks for your reply.<br>My understanding of designing such a database is that you<br>have to make two seperate entries into the database:<br>1. To add the record ( duser.recordset.addnew)<br>2. to save the record (duser.recordset.update)<br><br>Experience has shown me that people forget to update the database at times - perhaps its lunchtime or whatever!<br>I want to code something that will automatically attempt a Save every 5 mins - I also want something that will trap the user attempting to exit by using one of the icons at the top right of the screen - the &quot;X&quot; mark - which will exit the app - i want to be able to show the user a new form<br>(like the Windows Shutdown screen, with several option's<br>&nbsp;&nbsp;&nbsp;1. Shut Windows down.<br>&nbsp;&nbsp;&nbsp;2. Return to app.<br>&nbsp;&nbsp;&nbsp;3. Return to windows.<br>Thats about it. Hope that someone can help me- i don't know if i've explained it quite right but in my mind thats what it is!!<br><br>Thanks again..<br><br>Paul McLornan..<br><br>
 
If I understand your problem correctly the two Items below might help.<br><br>1.&nbsp;&nbsp;If you use the DataGrid bound to an adodc your changes will be saved when your user moves to another column or row.<br><br>2.&nbsp;&nbsp;You can use a message box in the forms QueryUnload proceedure to accomplish the second part of your problem.<br><br><br>I hope this helps. <br><br> <p>Robert L Norton<br><a href=mailto:2dogs@webace.com.au>2dogs@webace.com.au</a><br><a href= > </a><br>
 
Just a thought. If you want to display a form when the user closes your form use the unload event in the form and trigger the display of a modal form with your choices on it.<br><br>if you still wish to save your information to a temp file then you could adapt the code below.<br><br>Dim oTs As TextStream<br>Dim oFs As FileSystemObject<br>Dim Rof as string <br><br>Const filename = &quot;SomeFilePath&quot;<br><br>Set oFs = CreateObject(&quot;scripting.filesystemobject&quot;)<br><br>Rof = filename <br><br><br>If Dir(Rof) = &quot;&quot; Then<br>'If The File Does Not Exist Then Create It<br>&nbsp;&nbsp;&nbsp;&nbsp;Set oTs = oFs.CreateTextFile(filename & UName & &quot;.Pdl&quot;,False)<br><br>Else<br>&nbsp;&nbsp;&nbsp;&nbsp;Set oTs = oFs.OpenTextFile(Rof, ForAppending)<br>End If<br><br><br>oTs.WriteLine str<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>oTs.Close<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top