Showing posts with label mode. Show all posts
Showing posts with label mode. Show all posts

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.

Monday, March 19, 2012

connecting to MSDE

I installed MSDE 200 on my machine running XP home
edition.
I cant connect to the db using the SQL mode, but i can
connect using the in windows modes. It returns and odbc
error stae 28000 , i dont know how to correct this.
If set up and odbc connection and try to test this, it
returns the following errore
Attempting connection
[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'sa'. Reason: Not associated with a
trusted SQL Server connection.It looks like your MSDE instance is configured for Windows
Authentication only. The following article explains how to
change the authentication mode for MSDE during installation
as well as after installation:
INF: How to Change the Default Login Authentication Mode to
SQL While Installing SQL Server 2000 Desktop Engine by Using
Windows Installer
http://support.microsoft.com/?id=285097
-Sue
On Wed, 25 Feb 2004 19:31:09 -0800, "Lanre"
<lanre_makinde@.yahoo.com_remove.this> wrote:

>I installed MSDE 200 on my machine running XP home
>edition.
>I cant connect to the db using the SQL mode, but i can
>connect using the in windows modes. It returns and odbc
>error stae 28000 , i dont know how to correct this.
>If set up and odbc connection and try to test this, it
>returns the following errore
>Attempting connection
>[Microsoft][ODBC SQL Server Driver][SQL Server]Login
>failed for user 'sa'. Reason: Not associated with a
>trusted SQL Server connection.