Community discussion forum

Creating a database connection

This is a comment thread discussing Creating a database connection
  • 10 years ago

    This thread is for discussions of Creating a database connection.

  • 6 years ago

    It´s ok. works good

  • 6 years ago

    Sir,
    I am presently engaged in doing networking project in VB.NET and MSAcces.
    I would like to know the connection string
    (Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.......) for connecting to a database in another machine(given its machine name) in  a network while sitting in my own machine(also in the same network). I would be grateful if you help. Expecting your early reply,
    Thank you
    Renjini S
    Please mail me at
    srenjini@sify.com

  • 6 years ago

    I keep getting an error when I try and create a new data connection. This is the error I'm getting.


    Unable to connect to database.
    It is only possible to connect to SQL Server Desktop Engine databases and Microsoft Access with this version of Visual Studio.



    I can connect to Access without any problems. Is there anyway around this?
    I'm using VB .net Standard with SQL Server 2000.


    Thanks for any help.

  • 6 years ago

    Plz reply me when i ma writing in c# using System.Data.Ado for the database connection with m.s acess then it is giving errror  the type name space ado does not  exist in in the class system.Data.ADO
    what is reason
    plz answer me

  • 4 years ago
                                                 string connStr;
               string qryStr;
               OleDbConnection dbConn;
               
                                                    connStr = "Provider=Microsoft.Jet.OLEDB.4.0; " +
               "Data Source=G:\\Backup\\Kashif\\xyzDB.mdb";
               qryStr = "select content,websiteID  from content";
               dbConn = new OleDbConnection(connStr);
                           

    Amir
  • 3 years ago

    Hi..
    I'm trying to connect to an access database that is protected by password. but, it's always says "the database is being opened exclusively by another program" even I don't open other application. Please help me to solve this problem

  • 2 years ago
    Open connection to password protected Access database:
    "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; Jet OLEDB:Database Password=Your_Password"
  • 2 years ago
    hi i am trying to connect my vb. net prog tosql can yoi help me on how to do that..
    here is my codes..please tell my the error and what else do i need to put..
    Try





            Dim LintCount As Integer
            Dim resultValue As Boolean
            Dim myreader As SqlDataReader
            Dim conn As New SqlConnection("Datasource = TASDI;" + "userId = test;" + "password = test;")
            Dim myConnection As SqlConnection
            Dim myCommand As SqlCommand
            Dim strsql As String
           '     Call LSubfrmCnlenabled(True)


                myConnection = New SqlConnection("userId=Test;" + "password =Test;" + "datasource=TASDI;")
                establishing connection. you need to provide password for sql server
                myConnection.Open()
                opening the connection
                myCommand = New SqlCommand("Select * from M_EMPLOYEE", myConnection)
            executing the command and assigning it to connection

                myreader = myCommand.ExecuteReader()
                While myreader.Read()


                End While
                myreader.Close()
                myConnection.Close()
            Catch ex As Exception
            End Try



    please reply




























  • 1 year ago

    Thanks for taking the time to post this great little sample, complete with a working app and source code. It was very helpful to me. May you get laid constantly in college, graduate with a nice CS degree, and land a job at a hot game developer outfit where you get paid to have fun building stuff while making a ton of money. Cool 

  • 8 months ago
    I'm having a tough time connecting to an Access database using Visual Basic 2008. My connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Shep\Documents\Databasess\Contacts.mdb" but no mater what/how I try I get an exception. The message is "The Microsoft.Jet.OLEDB.4.0 provider is not registered on the local machine." I have no idea how to cope with this exception and have not been able to get any help anywhere else. Can someone 'splain this exception and help me overcome it? I'm running 64 bit Vista if that is of any consequence. Richard
  • 7 months ago
    Richard, You cannot use the JET OLEDB libraries in Vista or 2008 x64 running your .NET Applications in 64bit mode. So in your 'Configuration Management' change it to use x86 and it should work. If your using the 'Any CPU' profile, the .NET CLR will use the 64bit CLR when your .NET application runs which is where your problem lies. Hope this helps :-)

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback