Access database and the .Net Framework

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

If i write a program that is using a Accessdatabase, does the user
need anything else accept than the .Net Framework 1.1 to run my application.
 
Mario:

They'll need the MDAC (I believe 6.0 or higher but you should get the latest
ones just to be safe) components but those are probably already installed
with the framework. So no, I think you should be good to go.
Mario said:
If i write a program that is using a Accessdatabase, does the user
need anything else accept than the .Net Framework 1.1 to run my
application.
 
On 11 Mar 2004 12:44:48 -0800, (e-mail address removed) (Mario) wrote:

¤ If i write a program that is using a Accessdatabase, does the user
¤ need anything else accept than the .Net Framework 1.1 to run my application.

Yes, you will need the Jet database engine components as they are no longer included with MDAC.

How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine
http://support.microsoft.com/default.aspx?scid=kb;en-us;239114


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Paul,

I saw this answer more, OleDB is full part of Net and than you need for ms
access still the Jet DLL's.

Are you really sure of that?

Is this not only if you use ADODB ?

Cor
 
¤ Hi Paul,
¤
¤ I saw this answer more, OleDB is full part of Net and than you need for ms
¤ access still the Jet DLL's.
¤
¤ Are you really sure of that?
¤
¤ Is this not only if you use ADODB ?

I don't see the Jet DLLs in the list (NETFX 1.1 Information):

INFO: Registry Entries and Files That Are Created When You Install the .NET Framework 1.1
http://support.microsoft.com/default.aspx?scid=kb;en-us;820892


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Paul,

Did you place this answer in the wrong thread maybe?

That was not the anwer on my question.

You told that it is needed mdac to download for an dotNet adonet application
and I asked you if you where sure of that, I thought that that was only if
you use Ado in dotNet?

Cor
 
¤ Hi Paul,
¤
¤ Did you place this answer in the wrong thread maybe?
¤
¤ That was not the anwer on my question.
¤
¤ You told that it is needed mdac to download for an dotNet adonet application
¤ and I asked you if you where sure of that, I thought that that was only if
¤ you use Ado in dotNet?

I think there is some miscommunication here. William indicated that MDAC was required. *I* indicated
that the Jet database engine components were required since an Access database is being used.

MDAC and the Jet components are now two different installations. Even if you use the .NET native
OLEDB provider you still need the Jet database engine components.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Paul,

I see your point now. It is about the access database itself and not about
the connection.

I did not see it from that point of view, this sounds for me as telling to
the user that he needs to install the latest SQL server updates when it is
depending a SQL server application.

But I think it is clear for me now, if I still understand you wrong please
tell me.

Thanks for your message.

Cor
 
Thank your for answers, but its still not 100% clear to me if i need
more than just the .NET framework in order to create and modify a
Access-Database.

Thank you
Mario
 
Thank you for answers, but its still not 100% clear to me if i need
more than just the .NET framework in order to create and modify a
Access-Database.

Thank you
Mario
 
Hi Mario,

A more complete sample I do not have.
There is needed that MDAC as Paul said.
(It is a little bit old so maybe there is some things to much in it)
It creates 2 access databases and copies the data from the first to the
second.

I hope this helps?

Cor

Option Strict On
Module Main
'set a reference to microsoft adox ext 2.7 for dll and security
Public Sub Main()
Dim catNewDB As ADOX.Catalog
catNewDB = New ADOX.Catalog
If System.IO.File.Exists("C:\test1\db1.mdb") Then
System.IO.File.Delete("C:\test1\db1.mdb")
System.IO.File.Delete("C:\test1\db2.mdb")
End If
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=C:\test1\db1.mdb")
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=C:\test1\db2.mdb")
catNewDB = Nothing
catNewDB = Nothing
Dim conn1 As OleDb.OleDbConnection = New OleDb.OleDbConnection
Dim conn2 As OleDb.OleDbConnection = New OleDb.OleDbConnection
conn1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test1\db1.mdb;"
conn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test1\db2.mdb"
conn1.Open()
Dim cmd1 As New OleDb.OleDbCommand( _
"CREATE TABLE tbl1 (a int NOT NULL," & _
"b Char(20)," & _
"CONSTRAINT [pk_a] PRIMARY KEY (a))", conn1)
cmd1.ExecuteNonQuery()
conn2.Open()
Dim cmd2 As New OleDb.OleDbCommand( _
"CREATE TABLE tbl1 (a int NOT NULL," & _
"b Char(20)," & _
"CONSTRAINT [pk_a] PRIMARY KEY (a))", conn2)
cmd2.ExecuteNonQuery()
Try
For i As Integer = 1 To 9
cmd1.Parameters.Clear()
cmd1.CommandText = "INSERT INTO tbl1 (a,b) VALUES (@a,@b)"
cmd1.Parameters.Add(New OleDb.OleDbParameter("@a",
OleDb.OleDbType.Integer)).Value = i
cmd1.Parameters.Add(New OleDb.OleDbParameter("@b",
OleDb.OleDbType.Char, 20)).Value = Chr(64 + i)
cmd1.ExecuteNonQuery()
Next
For i As Integer = 4 To 12 Step 2
cmd2.Parameters.Clear()
cmd2.CommandText = "INSERT INTO tbl1 (a,b) VALUES (@a,@b)"
cmd2.Parameters.Add(New OleDb.OleDbParameter("@a",
OleDb.OleDbType.Integer)).Value = i
cmd2.Parameters.Add(New OleDb.OleDbParameter("@b",
OleDb.OleDbType.Char, 20)).Value = Chr(75 + i)
cmd2.ExecuteNonQuery()
Next
cmd1.CommandText = "Select * from tbl1"
Dim da1 As New OleDb.OleDbDataAdapter(cmd1)
Dim ds1 As New DataSet
Dim dt1 As New DataTable("tbl1")
Dim dca As New DataColumn("a", Type.GetType("System.Int32"))
Dim dcb As New DataColumn("b", Type.GetType("System.String"))
dt1.Columns.Add(dca)
dt1.Columns.Add(dcb)
ds1.Tables.Add(dt1)
cmd1.CommandText = "Select a, b from tbl1"
Dim rdr As OleDb.OleDbDataReader
rdr = cmd1.ExecuteReader()
While rdr.Read()
Dim dr As DataRow
dr = ds1.Tables(0).NewRow
dr("a") = rdr.GetInt32(0)
dr("b") = rdr.GetString(1)
ds1.Tables(0).Rows.Add(dr)
End While
rdr.Close()
ds1.AcceptChanges()
cmd2.CommandText = "Select * from tbl1"
cmd2.Connection = conn2
Dim da2 As New OleDb.OleDbDataAdapter(cmd2)
Dim cmb2 As New OleDb.OleDbCommandBuilder(da2)
Dim ds2 As New DataSet
conn2.Close()
da2.Fill(ds2)
For i As Integer = 0 To ds1.Tables(0).Rows.Count - 1
Dim swN As Boolean = True
For y As Integer = 0 To ds2.Tables(0).Rows.Count - 1
Dim a As Integer = ds2.Tables(0).Rows.Count - 1
If CInt(ds1.Tables(0).Rows(i).(0)) =
CInt(ds2.Tables(0).Rows(y).(0)) Then
ds2.Tables(0).Rows(y).Item(1) =
ds1.Tables(0).Rows(i).Item(1)
swN = False
Exit For
End If
Next
If swN Then
Dim dr As DataRow
dr = ds2.Tables(0).NewRow
For y As Integer = 0 To
ds1.Tables(0).Rows(i).ItemArray.Length - 1
dr(y) = ds1.Tables(0).Rows(i).ItemArray(y)
Next
ds2.Tables(0).Rows.Add(dr)
End If
Next
da2.Update(ds2)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
conn1.Close()
conn2.Close()
End Sub
End Module
///
 
On 16 Mar 2004 00:06:46 -0800, (e-mail address removed) (Mario) wrote:

¤ Thank you for answers, but its still not 100% clear to me if i need
¤ more than just the .NET framework in order to create and modify a
¤ Access-Database.

Install the latest version of MDAC first, then the Jet Service Pack for the target OS and then the
..NET Framework.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top