Sunday, March 25, 2012

Connecting to SQL 6.5 with VB.NET

Hi,

I am trying to connect to a SQL 6.5 database with VB.NET.

Is this possible, and if so, what kind of connection string is used and what mode of data access (OleDB, ODBC, etc.)

I have had several problems doing this and I am starting to wonder if there is anything special that needs to be done or if it is even possible. Thanks in advance!OleDB. Check out http://www.connectionstrings.com/|||Alright, I tried creating an OleDB Connection using Visual Studio. I set up the connection and it connects fine. I can view the tables and it says that it connects to the datasource. But when I try to use the connection in the page I get this error:

System.ArgumentException: The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc). at System.Data.OleDb.OleDbConnectionString.ValidateNotMSDASQL(String progid) at System.Data.OleDb.OleDbConnectionString.ValidateParse() at System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) at System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString) at System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) at ask.testconn.Page_Load(Object sender, EventArgs e) in \\cnsrfdiis01\intranet\ask\testconn.aspx.vb:line 31

Why would it be able to connect in the VS.NET Server Exlporer, but not in a page. I am just trying to open the database and close it. Here is the connection string I am using:

Provider=SQLOLEDB;Persist Security Info=False;User ID=crystal;Initial Catalog=lmsprod;Data Source=10.1.121.22;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=AROCAPTEST;Use Encryption for Data=False;Tag with column collation when possible=False

Thanks in advance!|||Ok, I was wrong. I went and checked, and you should be using the ODBC driver. Sorry. Try that and see if you still have the error.

No comments:

Post a Comment