I have an access module that parses a file and creates a couple SQL queries within Access and I am migrating to SQL Server Express.
I have MS Visual Basic, and I have created a new DataProject and added a Module, but I am having trouble connecting to my SQL Express Database because what I am finding online is tutorials on connecting via a .mdf file using something like this:
I want to make a persistent connection to the actual database that is live when I do this. It is my understanding that this style of connection is for shipping an application, and that this .mdf string style connection would be on a static form of the database, not the live one. If I am incorrect, and this style of connecting to the DB is actually live, how can I find out where my .mdf file is?
I am understanding this correctly, how would I go about connecting to the live database within Visual Basic so that I may make live charges to the database?
I have MS Visual Basic, and I have created a new DataProject and added a Module, but I am having trouble connecting to my SQL Express Database because what I am finding online is tutorials on connecting via a .mdf file using something like this:
Code:
Dim cn As ADODB.Connection
Set cn = New Connection
cn.ConnectionString = "Provider=SQLNCLI.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"AttachDBFileName=" & App.Path & "\northwnd.mdf;Data Source=server1\sqlexpress"
cn.Open
I want to make a persistent connection to the actual database that is live when I do this. It is my understanding that this style of connection is for shipping an application, and that this .mdf string style connection would be on a static form of the database, not the live one. If I am incorrect, and this style of connecting to the DB is actually live, how can I find out where my .mdf file is?
I am understanding this correctly, how would I go about connecting to the live database within Visual Basic so that I may make live charges to the database?