ODBC Connection Problem
-
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }
-
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }
-
Are you sure your user name and password are correct? The database name appears to be missing as well.
thanks for reply. yes username and password is correct. where i put database name???
-
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }
go through this like this may help u http://connectionstrings.com/sql-server-2005[^]
Rajesh B --> A Poor Workman Blames His Tools <--
-
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }
mjawadkhatri wrote:
OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");
try this:
OdbcConnection conn = new OdbcConnection("DSN=test;UID=sa;PWD=java;");
this is assuming that you have created a DSN entry with name test. -
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }
Try this to include your database nam:
OdbcConnection cn= new OdbcConnection("Driver={SQL Server};Server=mySQLServer;UID=sa;
PWD=myPassword;Database=Northwind;");Also make sure that your Sql Server 2005 allows remote connections because by default it doesn't!
-
thanks for reply. yes username and password is correct. where i put database name???
OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;**DataBase=DataBaseName;**UID=sa;PWD=java;");
-
Hi. I try to connect sql server 2005 through OBDC connection bt i face a error please give me some solution, i face this error ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). my Coding is OdbcConnection conn = new OdbcConnection("Driver={SQL Server};Server=test;UID=sa;PWD=java;");// test is my ODBC connection name string query = "INSERT INTO test VALUES ('" + textBox1.Text + "','" + textBox2.Text + "')"; OdbcCommand cmd = new OdbcCommand(query, conn); try { conn.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Record Inserted."); } finally { conn.Close(); }