user133466
user133466

Reputation: 3415

What mstrConnection should I use on a webpage to access local SQL Server Express (localhost\SQLEXPRESS)?

Would the following suffice?

Dim mstrConnection As String =
  "workstation id=COMPUTER;packet size=4096;data source=localhost\SQLEXPRESS;
    integrated security=false;user id=x309-PC\x309;password=abc"

Upvotes: 0

Views: 138

Answers (1)

BoxerBucks
BoxerBucks

Reputation: 3124

You should be able to get away with a simpler connection string like the following:

Data Source=(local)\SQLExpress;Initial Catalog=myDatabaseName;User ID=myUsername;Password=myPassword;

You also need to make sure in the SQL server security logins you have both mapped the user to a SQL login as well as given the user rights to the database you are interacting with. You can download MS SQL management studio express 2008 to view and set these settings.

Upvotes: 2

Related Questions