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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<B> Inserting New Records </B>

Status
Not open for further replies.

nipchop

Technical User
Jan 22, 2001
28
0
0
GB
Hi,

I have an access database that contains information about schoools linked to a HTML form document. I have already created a search that picks up certain information but I am unable to insert a record.

The fields are...

Index(Autonumber)
Name(Text)
School(Text)
Form Tutor(Text)
Date(Date)

I have tried lots of different varitions but non work, and I'm sure that I will have a problem with date as it will be entered as a string but will need to be put in as a date in the database. Can anyone help!!!

Tim
 
What do you mean you are unable to insert a record??
Are the fields being populated from a webpage?? Meaning, on an HTML file the user fills out aform and the database is then populated with the relevant information?? If this is what you want then using coldfusion and access you can do this easily.
As for the Date portion, I would leave that text also, because the user (assuming this is also being populated from a HTML file) won't know what format date to enter. by using text you cover yourslef from slow users and even some mishchivious users'...
Know what I mean?? if i'm missing something here, let me know... I have not failed; I merely found 100,000 different ways of not succeding...
 
Cheers,

I know what you mean about the date - it seems easier that way.

As for inserting the records, I have tried to write the ASP code for this so that it takes the contents of a form and enters it into the DBase. I have some code but there are too many ASP errors. I'm sure that there is something simple that I am missing.

Tim
 
Hello, you still haven't answered my question: Is the form supposed to be populated via a webpage?? Since you're using ASP, i'm assuming you will be.
There is an easier solution: Coldfusion. If you're server allows you to have .cfm files then you can have what you want done from coldfusion...we use this for our work all the time, its easy to create/edit and maintain as well... I have not failed; I merely found 100,000 different ways of not succeding...
 
<%
name=(request.form(&quot;txtname&quot;))
school=(request.form(&quot;txtschool&quot;))


set db= server.createObject(&quot;ADODB.Connection&quot;)
set rs=server.createObject(&quot;ADODB.Recordset&quot;)
dbEleves.open &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=&quot; & server.mappath(&quot;.&quot;) & &quot;/dbs/database.mdb&quot;
rsETU.open &quot;table&quot;,db,1,2,2


rs.AddNew
rs(&quot;fieldname&quot;)=name '
rsETU(&quot;fieldschool&quot;)=school '
rsETU.update

%>


A simple way of updating a database. Have Fun...

Sharky99 >:):O>
 
If you send me an email message with an example of your code, and the url your form is at I can help you correct your asp errors for creating a record... the easiest thing is for me to see what error it coming up though...

-Mike
mjewell@kmconnections.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top