Friday, July 31, 2009

ASP Coding to Connect with Access Database?

I am designing one website. I want to collect the details about the users through a HTML form. Please give me the ASP Coding (Not ASP.NET Coding) to connect the Form with Access Database and update the Access Database with the information given by the users through my HTML Form.

ASP Coding to Connect with Access Database?
Connecting to MS Access database from Classic ASP can be accomplished in several ways. You can connect using OLEDB DSN-less connection, you can connect using ODBC connection or you can use DSN.





1. Connect to a Microsoft Access Database from ASP using a DSN





Set oConnection = Server.CreateObject("ADODB.Connection")


oConnection.Open "DSN=;UID=;PWD="


oConnection.Close





The ASP connection example above is very simple and all you need to do is to create a DSN for your MS Access database.





2. Connect to a Microsoft Access Database from ASP using DSN-less ODBC connection





Set oConnection = Server.CreateObject("ADODB.Connection")


oConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" %26amp;


Server.MapPath("") %26amp; ";UID=;PWD="


oConnection.Close


Set oConnection = Nothing





This ASP MS Access connection example doesn’t require DSN, but requires that you have Microsoft Access Driver installed on your computer/server.





3. Connect to a Microsoft Access Database from ASP using DSN-less OLEDB connection





Set oConnection = Server.CreateObject("ADODB.Connection")


oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" %26amp;


Server.MapPath("") %26amp; ";"


oConnection.Close


Set oConnection = Nothing
Reply:This site should help


No comments:

Post a Comment