Solved

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

Posted on 2010-09-18
7
700 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
ID: 33708172
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
ID: 33708226
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
ID: 33708253
Thanks for your reply.

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



0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33708297
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33708310
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
ID: 33710687
0
 

Author Comment

by:futurebuilders
ID: 34478688
thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

815 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

8 Experts available now in Live!

Get 1:1 Help Now