|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Connection issueScenario: I have 2 apps, one VB6, one VS2003 (VB.Net). From the same
workstation, on the same LAN, the VB6 app can connect to the SQL Server (running on an XP Pro box), but the VB.Net app cannot. Connection strings are functionally identical as shown below. I've read the connection issues on Bill Vaughn's website, and while it's possible I'm overlooking something, I'm not convinced that the connectivity should be any different for a VB6 app than it would be for a VB.Net app. Any thoughts beyond the usual? VB6 strCN = "Provider=sqloledb;" & _ "Data Source=" & strDBServer & ";" & _ "Initial Catalog=" & strDBName & ";" & _ "Integrated Security=SSPI" VB.Net strCN As String = "data source=" & strDBServer & ";" & _ "initial catalog=" & strDBName & ";integrated security=SSPI;" Ok, what is in strDBServer? As you suspect, this should work (and it usually
does). Can you connect via the Server Explorer in VS.NET? If you can, can you connect via the connectionstring it uses? Are you referencing the server instance? Do you have a Try/Catch enabled? What's the exception message? Of course, many of these messages are less than helpful (pointing off to irrelevant issues). hth -- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Earl" <brikshoe@newsgroups.nospam> wrote in message news:O%23%23AlIilGHA.4512@TK2MSFTNGP04.phx.gbl... > Scenario: I have 2 apps, one VB6, one VS2003 (VB.Net). From the same > workstation, on the same LAN, the VB6 app can connect to the SQL Server > (running on an XP Pro box), but the VB.Net app cannot. Connection strings > are functionally identical as shown below. I've read the connection issues > on Bill Vaughn's website, and while it's possible I'm overlooking > something, I'm not convinced that the connectivity should be any different > for a VB6 app than it would be for a VB.Net app. Any thoughts beyond the > usual? > > VB6 > strCN = "Provider=sqloledb;" & _ > "Data Source=" & strDBServer & ";" & _ > "Initial Catalog=" & strDBName & ";" & _ > "Integrated Security=SSPI" > > VB.Net > > strCN As String = "data source=" & strDBServer & ";" & _ > "initial catalog=" & strDBName & ";integrated security=SSPI;" > strDBServer is the server name, in this instance, "EARL-XPPRO".
I *can* connect locally on the box with the VB.Net app. That is to say, the SQLServer is also the development machine. Both the VB6 and the VB.Net app can connect to the server. This is both in from within the IDE and from a compiled application. Thus, it is certainly true that I can connect with VS.Net using the server explorer. The sole issue is connecting to the server on a non-development machine within the LAN. I do have a Try/Catch and it is telling me "SQL Server does not exist or access denied." Show quote "William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message news:%23R3SzUilGHA.4512@TK2MSFTNGP04.phx.gbl... > Ok, what is in strDBServer? As you suspect, this should work (and it > usually does). Can you connect via the Server Explorer in VS.NET? If you > can, can you connect via the connectionstring it uses? > Are you referencing the server instance? Do you have a Try/Catch enabled? > What's the exception message? Of course, many of these messages are less > than helpful (pointing off to irrelevant issues). > > hth > > -- > ____________________________________ > William (Bill) Vaughn > Author, Mentor, Consultant > Microsoft MVP > INETA Speaker > www.betav.com/blog/billva > www.betav.com > Please reply only to the newsgroup so that others can benefit. > This posting is provided "AS IS" with no warranties, and confers no > rights. > __________________________________ > > "Earl" <brikshoe@newsgroups.nospam> wrote in message > news:O%23%23AlIilGHA.4512@TK2MSFTNGP04.phx.gbl... >> Scenario: I have 2 apps, one VB6, one VS2003 (VB.Net). From the same >> workstation, on the same LAN, the VB6 app can connect to the SQL Server >> (running on an XP Pro box), but the VB.Net app cannot. Connection strings >> are functionally identical as shown below. I've read the connection >> issues on Bill Vaughn's website, and while it's possible I'm overlooking >> something, I'm not convinced that the connectivity should be any >> different for a VB6 app than it would be for a VB.Net app. Any thoughts >> beyond the usual? >> >> VB6 >> strCN = "Provider=sqloledb;" & _ >> "Data Source=" & strDBServer & ";" & _ >> "Initial Catalog=" & strDBName & ";" & _ >> "Integrated Security=SSPI" >> >> VB.Net >> >> strCN As String = "data source=" & strDBServer & ";" & _ >> "initial catalog=" & strDBName & ";integrated security=SSPI;" >> > > Step through the connection checklist on my blog--this might help.
-- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Earl" <brikshoe@newsgroups.nospam> wrote in message news:OAusbKnlGHA.2136@TK2MSFTNGP04.phx.gbl... > strDBServer is the server name, in this instance, "EARL-XPPRO". > > I *can* connect locally on the box with the VB.Net app. That is to say, > the SQLServer is also the development machine. Both the VB6 and the VB.Net > app can connect to the server. This is both in from within the IDE and > from a compiled application. Thus, it is certainly true that I can connect > with > VS.Net using the server explorer. > > The sole issue is connecting to the server on a non-development machine > within the LAN. > > I do have a Try/Catch and it is telling me "SQL Server does not exist or > access denied." > > "William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message > news:%23R3SzUilGHA.4512@TK2MSFTNGP04.phx.gbl... >> Ok, what is in strDBServer? As you suspect, this should work (and it >> usually does). Can you connect via the Server Explorer in VS.NET? If you >> can, can you connect via the connectionstring it uses? >> Are you referencing the server instance? Do you have a Try/Catch enabled? >> What's the exception message? Of course, many of these messages are less >> than helpful (pointing off to irrelevant issues). >> >> hth >> >> -- >> ____________________________________ >> William (Bill) Vaughn >> Author, Mentor, Consultant >> Microsoft MVP >> INETA Speaker >> www.betav.com/blog/billva >> www.betav.com >> Please reply only to the newsgroup so that others can benefit. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> __________________________________ >> >> "Earl" <brikshoe@newsgroups.nospam> wrote in message >> news:O%23%23AlIilGHA.4512@TK2MSFTNGP04.phx.gbl... >>> Scenario: I have 2 apps, one VB6, one VS2003 (VB.Net). From the same >>> workstation, on the same LAN, the VB6 app can connect to the SQL Server >>> (running on an XP Pro box), but the VB.Net app cannot. Connection >>> strings are functionally identical as shown below. I've read the >>> connection issues on Bill Vaughn's website, and while it's possible I'm >>> overlooking something, I'm not convinced that the connectivity should be >>> any different for a VB6 app than it would be for a VB.Net app. Any >>> thoughts beyond the usual? >>> >>> VB6 >>> strCN = "Provider=sqloledb;" & _ >>> "Data Source=" & strDBServer & ";" & _ >>> "Initial Catalog=" & strDBName & ";" & _ >>> "Integrated Security=SSPI" >>> >>> VB.Net >>> >>> strCN As String = "data source=" & strDBServer & ";" & _ >>> "initial catalog=" & strDBName & ";integrated security=SSPI;" >>> >> >> > > |
|||||||||||||||||||||||