Home > Microsoft Access Help > Sending Information to a Database

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


    
Guest


I can help you to write the code in ASP. U have to post the column names.



Thanks,

Ashi

http://www.ringvirginia.com

Was this answer helpful ? Yes No   
Guest


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

Was this answer helpful ? Yes No   
Guest


<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

Was this answer helpful ? Yes No   
Guest


<%



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

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved