Hello everyone,

I'm writing up a new application that instead of using microsoft as a server, I'm using a linux server with a database in it. The database was setup, the tables were set up, and access was granted in mysql. The issue I'm having is that I keep getting an error message with error 25 stating that "A network related or instance specific error occurred." then it goes down to say error -25 connection string is not valid. This is the connection method that I am utilizing:

        On Error GoTo errorhandler

        Dim con As New SqlClient.SqlConnection("server=192.168.0.23:3306; database=test; user ID=root;Password=password;Integrated Security=true;")
        Dim cmd As SqlCommand
        cmd = New SqlCommand("SELECT * FROM students", con)
        Dim da As SqlDataAdapter
        Dim ds As DataSet
        da = New SqlDataAdapter(cmd)
        ds = New DataSet
        da.Fill(ds, "students")

        MsgBox(ds)

        con.Open()
        DataGridView1.DataSource = ds.Tables("students").DefaultView
        con.Close()

        Exit Sub
errorhandler:
        MsgBox(Err.Description, vbExclamation)

Does anyone have an idea as to why this is not working? Or, how to get this working? I would greatly appreciate it.

Recommended Answers

All 2 Replies

Is the ip address, user ID and password correct? I hope you didn't actually post the correct password.

lol I changed the passwords for safety but it doesn't matter as the server is in-house and once the server is worked on it will have these defaults changed. When I try to connect through telnet I get some funky errors. When I go through phpmyadmin it connects just fine. Any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.