Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 748
  • Last Modified:

Connection string for MS access 2000 data base in vb.net

Hi,

I am using MS access 2000 as data base with vb.net windows application.Using VS 2005 version.

Thanks in advance
0
futurebuilders
Asked:
futurebuilders
  • 2
  • 2
  • 2
  • +1
1 Solution
 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Take a look www.connectionstrings.com ...and check strings with access
hope it helps...
0
 
rockiroadsCommented:
For vb.net you have to use OleDbConnection as that supports Jet

this is sample code I have in my test app. It reads the db, runs the sql and returns the result


        Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\test.mdb"
        Dim conn As OleDbConnection
        Dim cmd As OleDbCommand
        Dim reader As OleDbDataReader
        Dim sql As String

        conn = New OleDbConnection(connectionString)

        conn.Open()
        sql = "SELECT COUNT(*) AS MyTotal FROM Table1"
        cmd = New OleDbCommand(sql, conn)
        reader = cmd.ExecuteReader()
        reader.Read()

        MsgBox(reader.Item("MyTotal"))
        conn.Close()


and the two namespaces I included are

Imports System.Data.SqlClient
Imports System.Data.OleDb


0
 
futurebuildersAuthor Commented:
Thanks for your reply.

But the above code is giving error as "Could not find installation of ISAM"



0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
0
 
rockiroadsCommented:
what version dotnet are you using? not your vs version but the framework. earlier versions of ado.net didnt work very well apparently http://support.microsoft.com/kb/318161

can u post the connection string you used? make sure no errors in there.
0
 
Mohamed AbowardaSoftware EngineerCommented:
0
 
futurebuildersAuthor Commented:
thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now