Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


when to call addrecord() in data entry form using DTC's?

Posted on 2000-02-26
Medium Priority
Last Modified: 2006-11-17
friends  i want to create a simple data-entry form using
DTC's. suppose this form is based on a table(emp) containing
 one primary field(ename). i'm using 1 DTC recordset (recordset1,which
is based on sql-->select ename from emp where 1=2, since i
don't want to display any existing record, it has to be only
 a data-entry form and not updateable form.), 1 DTC textbox(ename)
 and a DTC button(save) which i want to use for saving the record.
now my problem is where and when to call addrecord()  method?

i've achieved this goal by using a separate button by clicking which i
call this method. but i want this to happen automatically. so that
i only have to call updaterecord() when i press "save" button.

looking forward for your helping hand.

Question by:sandeeptyagi
  • 4
  • 3

Expert Comment

ID: 2563804
Sorry sandeeptyagi, no help here.  But I am curious, what's DTC?


Author Comment

ID: 2565569
hi spruce22

u wanted to know about DTC's.

 well... DTC stands for Design Time Control. they come with vis. interdev  6.0 , and are used to reduce the hard-Coding. u can simply drag them over to ur asp page ,change the properties. and that's it. they will generate the equivalent script for u. so u see they are of great use. like for creating a recordset manually, u need to write so many stmts. for ex., creating an instance of connection, recordset, then those commands, locking type, cursor type , command time out and so and so. now if u go for using one of DTC recordset, it's fun. there are several other DTC controls as well.
now u don't take them to be ActiveX controls. these are not ActiveX controls . But only a graphical representation of the same hard-coding. so ultimately u are getting the same stmts( more professionaly written) and ofcourse easy to customise. and therefore u don't need them to be registered anywhere on server or look for any browser plugin.all u need is to know how to use them.

   i would suggest u to try them if u really are unaware of them and so far doing hard-coding. for  i'm sure they'll make ur life comfortable to some extent.


Expert Comment

ID: 2567266

Aren't there events for the DTC text box control?  Something like OnChange, or AfterUpdate?  I'm famaliar with events in Access, not ASP but I know there has to be one which would be suitable.  This way, when a user enters data into the text box, you add the new record.  When they are completed they'd press save.

Thanks for the explanation of DTC's:)
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 2569117
dear spruce22
thanx for ur help. but let me tell u few things about DTc's.
when we use DTC's we get a chance to choose between either server or clint plateform, where we would kike this script to run. now if we choose server, and go for writing afterupdate of textfield then as many times user(surfer) updates(or i should say reenters) the control will go to server to execute the script .and that's highly unwanted.

so u see we can't go for that.

anyway thanx once more and feel free to speak ur mind


Accepted Solution

spruce22 earned 80 total points
ID: 2571270

Yes I see how inefficient that would be.  But let me say this, and tell if I'm off somwhere.  Right now you say you've accomplished the task by adding an extra button to call .AddRecord().  So when the button is pressed, the client page must call the server and add a new record.  It seems like the same thing as the inefficient AfterUpdate idea I had earlier.  Can you take a different approach to the situation? Instead of calling updaterecord() when the Save button is pressed - why don't you submit all the information from the form to an .asp page which calls both .AddRecord and .UpdateRecord.  You could use client side scripting to make sure all necesary data elements were entered, and have the Save button submit the information to let's say "AddRecord.asp".  AddRecord.asp would be the page with the recordset control.  From AddRecord.asp you could use either Request.Form("textboxname") or Request.QueryString("textboxname")(this is dependant on which method the form submits the data with - get or post) to retrieve the data from the form.  I don't know exactly how methods work for DTC controls, but the code might look something like this.

rsDTC.Field1 = Request.Form("textboxname")

Like I said - I'm somewhat guessing here, but maybe it'll stir up some thoughts for you.  Thanks for your patience and feedback.


Author Comment

ID: 2612903
hi spruce22
first of all sorry for the delay. the house was under heavy repairment
 so the system was put at such a place that i couldn't attach it to
 telephone line to access net. however i had received ur reply by then.

well.. what u said was absolutely right if i use 2 separate pages. and it
is not a problem. i wanted to do it with one page only. as of now i
have taken the very same root (2 diffrent pages) and it's working perfectly.
though in future if you come across the exact solution pls. let me know.



Expert Comment

ID: 2621880
hi sandeep,

No problem on the delay, glad you were able to get your stuff working.  As far as finding the exact solution, it seems to me that you'd always have to use two pages to add the records, unless you wanted the page to update itself.  For example, your form could submit the data to itself, and then you could call the .AddRecord & .UpdateRecord.  But it seems like that would require much more server side scripting than is necesary.  Maybe somebody else would know of a different way to accomplish this, but I'm out of brains:)


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Screencast - Getting to Know the Pipeline
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question