|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Sending Information to a Database
Hi All,
I have created a Microsoft Access Database on my PC and also have an online form on my site. I want this information to be sent directly to my database when a person hits the submit button on my page. I have nothing launched yet on the network but it's just temporarily on my pc. How would I set this up. I have all the fields in the database set up in 1 table and matching the fields in the form. Would anyone have code for this. I would be very grateful if someone could help me out. Cheers Last edited by buckleya1 : September 4th, 2003 at 06:51 AM. |
|
#2
|
|||
|
|||
|
I can help you to write the code in ASP. U have to post the column names.
Thanks, Ashi http://www.ringvirginia.com
__________________
Ashi Notani ashinotani@hotmail.com (Email) |
|
#3
|
|||
|
|||
|
Hi ya,
I have IIS on my machine so hopefully you're code would work. The name of my text fields are: patientName patientEmail patientDOB patientTelNo patient_entry_date The names of the fields in the Database are: Patient_Name Email_Address DateOfBirthTelephone_Number DateOfEntry Thanks very much for helping me out Alan |
|
#4
|
|||
|
|||
|
<form name="form1" method="post" action="form2.asp">
<p><strong><font size="4" face="Verdana, Arial, Helvetica, sans-serif">Form: </font></strong></p> <p> <input name="patientName" type="text" id="patientName"> </p> <p> <input name="patientEmail" type="text" id="patientEmail"> </p> <p> <input name="patientDOB" type="text" id="patientDOB"> </p> <p> <input name="patientTelNo" type="text" id="patientTelNo"> </p> <p> <input name="patient_entry_date" type="text" id="patient_entry_date"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> ------------------------------------------------------------------------------ save the above form as form1.asp Thanks, Ashi http://www.ringvirginia.com |
|
#5
|
|||
|
|||
|
<%
patientName=request.form("patientName") response.write patientName patientEmail=request.form("patientEmail") response.write patientEmail patientDOB=request.form("patientDOB") response.write patientDOB patientTelNo=request.form("patientTelNo") response.write patientTelNo patient_entry_date=request.form("patient_entry_date") response.write patient_entry_date 'response.End Set cnn = Server.CreateObject("ADODB.Connection") strConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("mdbname.mdb") & "; cnn.Open strConn Set rs = Server.CreateObject("ADODB.Recordset") 'rs.open "select * from sform",cnn cnn.execute "Insert INTO sform(Patient_Name,Email_Address,DateOfBirth,Telep hone_Number,DateOfEntry)values('"&patientName&"','"&patientEmail&"','"&patientDOB&"','"&patientTelNo&"','"&patient_entry_date&"')" %> Thanks, Ashi http://www.ringvirginia.com |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Sending Information to a Database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|