| | |
connect vb.net to ms access
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 32
Reputation:
Solved Threads: 4
Hi,
imports System.Data.OleDb
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DATABASE PATH")
con.Open()
If solved please mark as solved
imports System.Data.OleDb
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DATABASE PATH")
con.Open()
If solved please mark as solved
•
•
Join Date: Nov 2008
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
can someone help me how to connect database from ms access to vb.net??????
please help me..
By
Santhosh Kumar K.
•
•
Join Date: May 2008
Posts: 144
Reputation:
Solved Threads: 9
Imports System.Data
Module Test
Sub Main()
Dim sConnectionString, sSQL As String
'SQL Connection String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\yourdatabase.mdb"
sSQL = "SELECT Title FROM yourTable"
Dim conn As New System.Data.OleDb.OleDbConnection(sConnectionString)
Dim cmd As New System.Data.OleDb.OleDbCommand(sSQL, conn)
Dim dr As System.Data.OleDb.OleDbDataReader
conn.Open()
dr = cmd.ExecuteReader()
Do While dr.Read()
System.Console.WriteLine(dr.Item("Title"))
Loop
dr.Close()
conn.Close()
End Sub
End Module
Module Test
Sub Main()
Dim sConnectionString, sSQL As String
'SQL Connection String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\yourdatabase.mdb"
sSQL = "SELECT Title FROM yourTable"
Dim conn As New System.Data.OleDb.OleDbConnection(sConnectionString)
Dim cmd As New System.Data.OleDb.OleDbCommand(sSQL, conn)
Dim dr As System.Data.OleDb.OleDbDataReader
conn.Open()
dr = cmd.ExecuteReader()
Do While dr.Read()
System.Console.WriteLine(dr.Item("Title"))
Loop
dr.Close()
conn.Close()
End Sub
End Module
![]() |
Similar Threads
- VB: Connect to Access database via ODBC datasource name (Visual Basic 4 / 5 / 6)
- cant acess some websites and some programs wont connect to the net. (Viruses, Spyware and other Nasties)
- Cannot Connect to, Linksys' Web Based Utility, I need help (Networking Hardware Configuration)
- Problem with VB.NET and MS Access (VB.NET)
- How do I connect two Ethernet Networks (Networking Hardware Configuration)
- timer in VB.net (VB.NET)
- plz help me to connect more than one table in the ms access database to the asp.net (ASP.NET)
- cannot connect to LAN (Networking Hardware Configuration)
- help i cant connect to the internet!! (Windows 95 / 98 / Me)
Other Threads in the VB.NET Forum
- Previous Thread: Insert Dataset into SQL Database.
- Next Thread: Select Case Problem
| Thread Tools | Search this Thread |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms generatetags gridview html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





