mojal67 0 Newbie Poster

Hi ,I work with vb.net 2005 . I want to know if I want to connet to data base with Ms Access which data source i can use (ODBC or OLEDB)
I write the following code in form load event (by OLEDB) :

Dim conn As New OleDb.OleDbConnection("Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDBdatabase Locking Mode=1;Jet OLEDBdatabase Password=;Data Source=C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb;Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDBdon't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False")

Dim da As New OleDb.OleDbDataAdapter("select * from orders", conn)
Dim ds As New DataSet
da.Fill(ds)

and have an error that "OledbException was unhandled"
How can i solve this error or How can connect with ODBC data source to MS access data base.
I will happy if anyone can help me.
Thank You , MOJAL

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.