Solved

I cant connect to the database using windows 2000 professional ?

Posted on 2006-10-31
4
162 Views
Last Modified: 2010-04-23

My program work perfectly with computers that contain window xp operating system using OleDb in order to connect to access database, but it will fail to connect to the database using window 2000 pro operating.
 


however, I have install framework 2.0 +  framework 1.1 .
0
Comment
Question by:waddhah
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
ID: 17842275
Is that system installed Ms-Access or Microsoft Data Access Components (MDAC) ?
What error you are getting?
0
 
LVL 2

Expert Comment

by:jags_77
ID: 17842388
Hi there  waddah:


  i´ve used and tested this procedure on Windows 2000 and 2003:


- - - - Below the Inherits statement, enter the following:

Private strOLEDB_ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source =C:\Program Files\Microsoft Office\Office\Samples\Nortwind.mdb;"       - - - -  Just make sure the path is the correct one

Private cnOLEDB As New Oledb.OleDbConnection(strOLEDB_ConnectionString)



Private daCustomers As New Oledb.OleDbDataAdapter( "Select * from Customers",cnOLEDB)

Private cbCustomers As New Oledb.Oledb.CommandBuilder(daCustomers)

Private dsExamples As New DataSet("dsExamples")


- - - In a defined procedure load the data from your DB


Private Sub mnuOLEDB_ LoadData_Click ( )
daCustomers.Fill ( dsExamples, "Customers")

Dim dcCustomerID As DataColumn=dsExamples.Tables("Customers").Columns("CustomerID")

dsExamples.Relations.Add("CustOrders",dcCustomerID,dcOrderCustID)


hope this is useful..if you need something more please feel free to ask...









0
 

Author Comment

by:waddhah
ID: 17842805
I have used the falowing code .. what changes do I have to do ?

Try
            Dim dbCommand As OleDbCommand
            Dim DBConn As OleDbConnection
            Dim strFN, strLN As String
            Dim DBInsert As New OleDbCommand
            strFN = txtF.Text
            strLN = txtL.Text
            strDept = LocationBox.SelectedItem
            strPath = txtPath.Text
            DBConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source =C:\db.mdb;)" _
            DBInsert.CommandText = "Insert Into Employee " _
            & "(FName,LName) " _
            & "Values (" _
            & "'" & strFN & "', " _
            & "'" & strLN & "')"
            DBInsert.Connection = DBConn
            DBInsert.Connection.Open()
            DBInsert.ExecuteNonQuery()
            DBConn.Close()
        Catch err As System.Exception
            txtError.Text = err.Message
        End Try

... as I said before it work  in window xp only?

and tomorow  I will check the error msg and I will post it  , because I'm now  in home not in my company.
0
 

Author Comment

by:waddhah
ID: 17953478
I just have solve the problem by installing the MDAC 2.8
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

12 Experts available now in Live!

Get 1:1 Help Now