Solved

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

Posted on 2010-09-18
7
688 Views
Last Modified: 2012-05-10
Hi,

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

Thanks in advance
0
Comment
Question by:futurebuilders
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
Comment Utility
Take a look www.connectionstrings.com ...and check strings with access
hope it helps...
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
Comment Utility
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
 

Author Comment

by:futurebuilders
Comment Utility
Thanks for your reply.

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



0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
Comment Utility
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
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
 
LVL 12

Expert Comment

by:Mohamed Abowarda
Comment Utility
0
 

Author Comment

by:futurebuilders
Comment Utility
thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now