|
-
Feb 15th, 2003, 07:45 PM
#1
Thread Starter
New Member
MS Access
How can I display a MS Access db in VB.NET?
-
Feb 16th, 2003, 05:22 PM
#2
Hyperactive Member
vb_Tux,
the answer to that question has filled many books in bookstores around the world.
can you be more specific? like, do you wish to connect to an access db? add records? delete, update records? reports? grids?
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Feb 16th, 2003, 09:13 PM
#3
New Member
I have a .mdb file, how would I go about getting the contents of that? (displaying it into a data grid to be specific)
-
Feb 17th, 2003, 10:57 AM
#4
Member
VB Code:
'Create DataSet (thru adapter fill ds from table)
Imports System.Data.Oledb
Public Class Form1
Inherits System.Windows.Forms.Form
'form level declarations
Dim cn As OleDbConnection
Dim sConn As String
Dim ds As DataSet
Dim da As OleDbDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sDBNAme As String = "c:\TestDB\TestDB.mdb"
Dim sSQL As String = "select * from PRQ"
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDBNAme & ";Persist Security Info=False"
cn = New OleDbConnection(sConn)
ds = New DataSet()
da = New OleDbDataAdapter(sSQL, cn)
da.Fill(ds, "TableName")
'Bind dataGrid to DataSet
dg.DataSource = ds.Tables("TableName")
'Clean memory (Like Setting to Nothing)
ds.Dispose()
da.Dispose()
End Sub
End CLass
-
Feb 17th, 2003, 07:58 PM
#5
New Member
Oh thanks Your solved my problem, although I feel I hi-jacked vb_TuX's thread
-
Feb 18th, 2003, 09:11 AM
#6
Addicted Member
That example is pretty good for beginners, thanks Iouri!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|