CRUD with Access Database using ASP.NET

How can I use Microsoft Access as a database on an ASP.NET website? Is it possible?

+3
source share
4 answers

Yes it is possible. You will need to use OLEDB to access the MS Access database.

Dim con As New System.Data.OleDb.OleDbConnection

   Dim myPath As String
   myPath = Server.MapPath("Database1.mdb")

   con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
   Dim myCommand As New System.Data.OleDb.OleDbCommand

   myCommand.CommandText = "insert into Students(Firstname,Lastname,Address) values('" & txtFirstname.Text & "','" & txtLastname.Text & "','" & txtAddress.Text & "')"
   myCommand.Connection = con
   con.Open()
   myCommand.ExecuteNonQuery()
   con.Close()

Taken from: http://www.beansoftware.com/ASP.NET-Tutorials/Connecting-Access-Sql-Server.aspx

It will be the same as SQL Server, but you will use OleDbConnection, OleDbCommand, etc.

+2
source

Of course Access has an oledb connection

Now I would not recommend it if it is not a toy application. But yes, it can be done.

+3
source

Yes, it is possible, but NOT recommended!

Access was never intended to be used in a highly competitive environment, such as the Internet. I don’t know what type of site you are trying to create, but you are better off with a real database such as SQL Express (Free download at Microsoft)

+2
source

Source: https://habr.com/ru/post/1753658/


All Articles