Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone please suggest me the code for inserting data into access database usin asp....
Posted
Comments
R. Giskard Reventlov 12-Jul-10 3:32am    
What have you already tried?
Christian Graus 12-Jul-10 4:12am    
Do you really mean ASP and not ASP.NET ? That's so old as to be very hard to get help for, why would you use something so terrible when you're clearly learning ? If you're using ASP.NET, then there's so much information available on the web as to make the question ridiculous.
Sandeep Mewara 12-Jul-10 5:50am    
Use google, try online tutorials available. If you face issues then drop by and tell us.
E.F. Nijboer 12-Jul-10 6:25am    
If you would need to do this for classic asp, I would suggest just looking for VBA code for it. You would maybe just need a few adjustments to get it to work, but not difficult. Good luck!

1 solution

ok..Fortunately I happen to be one of the very people who still find ASP pretty cool..lol..but I think you should get ready to move to ASP.NET soon

ok here's sample code for what you want..

XML
<%@LANGUAGE="JavaScript"%>
var strConnect="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
strConnect += Server.MapPath("\\GOP") + "\\datastores\\gop.mdb;"
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<HTML>
<HEAD>
<TITLE>Adding data into a database List</TITLE>
</HEAD>
<BODY LINK="red" VLINK="red" ALINK="crimson">
<%
var sql = insert into ([field names]) values ([data to be inserted]);
var objConn=Server.CreateObject("ADODB.Connection");
objConn.Open(strConnect)
objConn.Execute(sql)
objConn.Close()
objConn = null;
Response.Write("The data has been added to the database.")
%>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900