Hello All
I have created a vb.net program that needs to connect the local instance of SQL Server in order to create a SQL Server database.
I have created a test program where the code is simply:
Works fine on the development computer, including when actually installed onto the development computer from published files.
When deploying on another computer it will download and install SQL Server Express if it is not already installed.
But won't access the database! Simply crashes on the conn.open line. Declaring the database is not accessible.
This includes on a server where I run ASP.NET apps which connect to a SQL Server database all the time.
Tried specifying the master database, again, worked locally but not on another computer.
Pipes is enabled, everything is enabled!
Tried a different connection string:
"Server=Localhost;Database=;Trusted_Connection=True;"
No difference.
Currently using a Win 7 machine, the code won't work on an XP machine I have but it DID work on that machine before the hard drive went kaflooie and everything was reinstalled.
Testing the installation on a server 2003 machine, and another xp machine. Both failed.
Added the instance name in:
"Server=localhost\SQLEXPRESS;Database=;Trusted_Connection=True;"
Same happened.
I am totally lost here, has anyone any ideas?
Many thanks
I have created a vb.net program that needs to connect the local instance of SQL Server in order to create a SQL Server database.
I have created a test program where the code is simply:
Code:
Public ConnectionString As String
Public reader As SqlDataReader = Nothing
Public conn As SqlConnection = Nothing
Public cmd As SqlCommand = Nothing
Public sql As String = Nothing
Sub CreateDB()
' Create a connection
ConnectionString = "Integrated Security=SSPI;Initial Catalog=;Data Source=Localhost;"
conn = New SqlConnection(ConnectionString)
' Open the connection
conn.Open()
conn.Close()
MsgBox("Result!!")
end sub
When deploying on another computer it will download and install SQL Server Express if it is not already installed.
But won't access the database! Simply crashes on the conn.open line. Declaring the database is not accessible.
This includes on a server where I run ASP.NET apps which connect to a SQL Server database all the time.
Tried specifying the master database, again, worked locally but not on another computer.
Pipes is enabled, everything is enabled!
Tried a different connection string:
"Server=Localhost;Database=;Trusted_Connection=True;"
No difference.
Currently using a Win 7 machine, the code won't work on an XP machine I have but it DID work on that machine before the hard drive went kaflooie and everything was reinstalled.
Testing the installation on a server 2003 machine, and another xp machine. Both failed.
Added the instance name in:
"Server=localhost\SQLEXPRESS;Database=;Trusted_Connection=True;"
Same happened.
I am totally lost here, has anyone any ideas?
Many thanks