Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help to Solve the database connection error.

Status
Not open for further replies.

neelimav

Programmer
Jun 27, 2003
1
US
Hi,

I am trying to connect to MSAccess2000 database thru VB.net.I get the error at the myconnection.open().
Here is my code.

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
Try
Dim MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Neelima\office\serp.mdb")
MyConnection.Open()
Dim MyCommand As New OleDb.OleDbCommand("SELECT * FROM serpmaster", MyConnection)
Dim MyReader As OleDb.OleDbDataReader = MyCommand.ExecuteReader()
TextBox1.Text = ""
'TextBox2.Text = "" ' Clear all text first before entering loop
While MyReader.Read
TextBox1.Text += MyReader("StudID")
TextBox1.Text += MyReader("Title")
TextBox1.Text += "==========End Of Record=========" ' Just to space
End While
MyConnection.Close()
MyReader.Close()
MyCommand.Dispose()
Catch e As OleDb.OleDbException
MsgBox(e.ToString())
Finally

End Try


Here is my error message.

System.data.oledb.oledbconnection: Could not find installable ISAM
at System.data.oledb.oledbconnection.Processresults(int32hr)
at System.data.oledb.oledbconnection.intializeprovider()
at System.data.oledb.oledbconnection.open()
at windowsapplication6.form1....ctor() in c:\......

ThanK you
Neelima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top