.net application, OLEDB, and SQL Server

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
danieleds
Newbie
Newbie
Posts: 4
Joined: Sat Jul 21, 2012 7:07 am

.net application, OLEDB, and SQL Server

Post by danieleds »

Hi, I have a .net application which tries to connect to a SQL Server database using an "OleDbConnection". The connection string is:

Code: Select all

Provider=SQLOLEDB; Data Source=HOST\sql2008; Initial Catalog=MYDB"; User Id=sa; Password=sa;
Named pipes don't seem to work, so I'm trying with an IP address (I can successfully connect via command line with "tsql -S '192.168.1.206\sql2008' -U sa").
But from the software, when I use "Data Source=192.168.1.206\sql2008", I get this error (after some seconds of timeout):
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
If I specify the IP address only ("Data Source=192.168.1.206"), it seems to connect immediatly, but I get a "wrong username/password" error. This is obvious, because I haven't specified an instance.

How can I fix this?
Aaron9615
Level 2
Level 2
Posts: 17
Joined: Wed Jun 13, 2012 9:46 am

Similar issue

Post by Aaron9615 »

Been working on an ODBC issue, does the program you have installed have a mdb file or something similar on the local install. This could be what is sending the SQL login data.
danieleds
Newbie
Newbie
Posts: 4
Joined: Sat Jul 21, 2012 7:07 am

Re: Similar issue

Post by danieleds »

Aaron9615 wrote:Been working on an ODBC issue, does the program you have installed have a mdb file or something similar on the local install. This could be what is sending the SQL login data.
Nope. I can provide the complete connection string directly, so the login data is not stored in any local file.
Aaron9615
Level 2
Level 2
Posts: 17
Joined: Wed Jun 13, 2012 9:46 am

Post by Aaron9615 »

Is it using Windows or Standalone authentication?
danieleds
Newbie
Newbie
Posts: 4
Joined: Sat Jul 21, 2012 7:07 am

Post by danieleds »

Aaron9615 wrote:Is it using Windows or Standalone authentication?
Standalone authentication. Maybe the "data source" parameter of the connection string should be written in a different format?
Aaron9615
Level 2
Level 2
Posts: 17
Joined: Wed Jun 13, 2012 9:46 am

Post by Aaron9615 »

Just curious, what happens if you do not specify the username and password? Do you get the same error?
RobertPattinson
Newbie
Newbie
Posts: 4
Joined: Mon Jul 16, 2012 2:42 am

Post by RobertPattinson »

Been working on an ODBC issue, does the program you have installed have a mdb file or something similar on the local install. what is sending the SQL login data
danieleds
Newbie
Newbie
Posts: 4
Joined: Sat Jul 21, 2012 7:07 am

Re:

Post by danieleds »

Aaron9615 wrote:Just curious, what happens if you do not specify the username and password? Do you get the same error?
Just tried. I get the same error.

So, to recap:

Provider=SQLOLEDB; Data Source=HOST\sql2008; Initial Catalog=MYDB; User Id=sa; Password=sa;
15s timeout, then: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Provider=SQLOLEDB; Data Source=192.168.1.206\sql2008; Initial Catalog=MYDB; User Id=sa; Password=sa;
15s timeout, then: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Provider=SQLOLEDB; Data Source=192.168.1.206; Initial Catalog=MYDB; User Id=sa; Password=sa;
Login failed for user 'sa'

Provider=SQLOLEDB; Data Source=192.168.1.206\sql2008; Initial Catalog=MYDB;
15s timeout, then: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Provider=SQLOLEDB; Data Source=192.168.1.206; Initial Catalog=MYDB;
Login failed for user 'sa'
Locked