I there is something wrong with the Connection string as you have it here,
cause the following code which was change to use it does not work even on my
stand alone pc. (btw, i set up a login for user "ar" and pw of "xx".
Dim c As String = "server=SQL;uid=ar;pwd=xx;database=AhavaOrder"
MsgBox("using as connection: " & c)
Dim conn As New SqlConnection(c)
Dim cmd As SqlCommand = New SqlCommand("select * from tblItem", conn)
cmd.CommandType = CommandType.Text
cmd.Connection.Open()
Dim reader As SqlDataReader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)
reader.Read()
MsgBox(reader.Item(0))
>> Dim c As String = "Data Source=SQL;Initial Catalog=AhavaOrder;Integrated
>> Security=True"
[quoted text clipped - 6 lines]
>
> Dim c As String = "server=SQL;uid=sa;pwd=pa$$w0rd;database=MyDatabase"
Josh Grameson - 10 May 2006 23:46 GMT
I'm Wrong!
This string actually does work, but only as much as the one that I was using
before with integrated security. Meaning this works on my home pc, and on
the non Novell drives on the network at work.
>I there is something wrong with the Connection string as you have it here,
>cause the following code which was change to use it does not work even on
[quoted text clipped - 29 lines]
>>
>> Dim c As String = "server=SQL;uid=sa;pwd=pa$$w0rd;database=MyDatabase"
Brendan Green - 10 May 2006 23:51 GMT
Is "uid" valid? Or is it supposed to be "User Id"?
>I there is something wrong with the Connection string as you have it here,
>cause the following code which was change to use it does not work even on
[quoted text clipped - 29 lines]
>>
>> Dim c As String = "server=SQL;uid=sa;pwd=pa$$w0rd;database=MyDatabase"
Josh Grameson - 11 May 2006 02:03 GMT
It must be valid since it works (from home computer, etc.) Plus this was
given to me by Jim who it seems is an expert here.
> Is "uid" valid? Or is it supposed to be "User Id"?
>
[quoted text clipped - 31 lines]
>>>
>>> Dim c As String = "server=SQL;uid=sa;pwd=pa$$w0rd;database=MyDatabase"
Jim in Arizona - 11 May 2006 17:12 GMT
Expert? no no! lol
I've been using that connection string for some time on several of my
web apps. I got it out of a book.
You can get specific connection strings from
http://www.connectionstrings.com which I have found somewhat useful in
the past.
As far as why you still can't connect, I'm not sure. Integrated security
uses windows trusts (active directory or local windows accounts) so if
you're using a computer that isn't windows or isn't part a windows
domain and you aren't logged onto that machine with a matching username
and password that the server has (ie: you're logged onto a workstation
as a local administrator with matching username/password
(administrator/mypassword) as the sql server computer (the local windows
account of administrator/mypassword, not the sql logon)).
As long as you're connecting strait to the sql service using sql
credentials, then it shouldn't matter where your connection is coming
from unless security on your sql computer is explicitly denying that
connection for some reason other than default reasons.
> It must be valid since it works (from home computer, etc.) Plus this was
> given to me by Jim who it seems is an expert here.
[quoted text clipped - 34 lines]
>>>>
>>>> Dim c As String = "server=SQL;uid=sa;pwd=pa$$w0rd;database=MyDatabase"