I develop my app on my personal computer, then transfer it to my work computer. The code below sets the connection string. The paths are both correct yet I receive the error 52 when testing it on the network.
Private Function getConnPath()
Dim WhereAmI As String = Environment.UserName,
p1 As String = "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=",
p2 As String,
p3 As String = ";Integrated Security=True;Connect Timeout=30",
r As String
If Environment.UserName = "Wayne" Then
p2 = "E:\dbETS.MDF"
Else
p2 = "\\americas.com\LIB\Joshua\dbETS.MDF"
End If
r = p1 & p2 & p3
Return r
End Function
I also tried the following connection strings which failed: Server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|dbETS.MDF;Trusted_Connection=Yes; Server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|dbETS.MDF;Database=dbETS;Trusted_Connection=Yes;
