[ brankec @ 21.02.2010. 12:55 ] @
Pozdrav.
Sta nije u redu sa sledecim kodom, odnosno kako da se povezem sa northwind bazom a da mi nejavlja sledece greske:
-Could not find installable ISAM
-Cannot start your application. The workgroup information file is missing or opened exclusively by another user

Code:
'Imports Data and Oledb namespaces ...
Imports System.Data
Imports System.Data.OleDb

Public Class Form1
    Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; DatSource=d:\Northwind.accdb; Jet OLEDB:System Database=system.mdw;")
    Dim objDataAdapter As New OleDbDataAdapter()
    Dim objDataSet As New DataSet()

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        objDataAdapter.SelectCommand = New OleDbCommand
        objDataAdapter.SelectCommand.Connection = objConnection
        objDataAdapter.SelectCommand.CommandText = "Select * From employees"
        objDataAdapter.SelectCommand.CommandType = CommandType.Text

        'Open database connection ...
        objConnection.Open()

        'Fill dataset object with data
        objDataAdapter.Fill(objDataSet, "Employees")

        'Close database connection ...
        objConnection.Close()

        'Set the DatGridView properties to bind data
        DataGridView1.AutoGenerateColumns = True
        DataGridView1.DataSource = objDataSet
        DataGridView1.DataMember = "Employees"

        'Clean up
        objDataAdapter = Nothing
        objConnection = Nothing

    End Sub
End Class
[ anebojsa @ 22.02.2010. 09:46 ] @
Dim objConnection As New OleDbConnection("Provider=" & "Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & "c:\Temp\WindowsApplication1\bin\db1.mdb")

c:\Temp\WindowsApplication1\bin\db1.mdb - ovo zameni putanjom do tvoje baze
[ y9s4gee @ 01.03.2010. 09:22 ] @
Mozda je bolje da se napravi jedan modul i njemu da se deklarise putanja. On ce biti vidljiv za ceo projekat a ovako bi morao da za svaku formu deklarises konekciju.
[ draganmit @ 27.03.2010. 20:06 ] @
posto je access2007 u pitanju, probaj ovako:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;