Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:33:15+00:00 2026-06-18T09:33:15+00:00

I am a developer building websites in VB.Net using Visual Studio 2010. I am

  • 0

I am a developer building websites in VB.Net using Visual Studio 2010. I am trying to populate some fields when a user visits a website based on their decisions on a previous screen.

My connection information is as follows:

Dim myDataReader As SqlDataReader
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim strSQL As String

myConnection = New SqlConnection("Data Source=localhost\sqlexpress; Database=PREP; Integrated Security=SSPI;")
Try
    myConnection.Open()
Catch ex As Exception
    MsgBox(ex.Message)
End Try

strSQL = "SELECT * FROM Charts where ID=1"

myCommand = New SqlCommand(strSQL, myConnection)

myDataReader = myCommand.ExecuteReader()

If myDataReader.Read() Then
    TextBox1.Text = myDataReader.Item("Priority1")
Else
    MsgBox("Didn't work...")
End If

The error I continue to get is:

Cannot open database “PREP” by the login. The login failed. Login failed for user ‘OR-AA-Me\Me’

I assumed that since it was a local database I would not need a username and password. Am I wrong?

Also, are there glaring practices in the above code that will be unwise when I transport this to a commercial environment?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:33:16+00:00Added an answer on June 18, 2026 at 9:33 am

    Solved:

    The connection string simply needed additional filepath information.

    The successful connection information was:

    myConnection = New SqlConnection(“Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\PREP.mdf; Integrated Security=True; User Instance=True”)

    There was no need for a username as the Integrated Security set to True assumes that the computer will use the login information for the user on the actual computer he is using.


    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using the chrome developer tools for some basic html websites and
I'm building a website with Rails which can let user check if some domains
I'm building an ASP.NET website that will act as a framework and display information
Im currently a C# developer with a few years of experiance building websites with
I want to develop a personal blogging website using ASP.NET MVC 4. I know
I'm a web developer building my first production grade console application (C# .NET 4.0).
I have an existing website developped using ASP.NET MVC 3 and Entity Framework 4
I am building a website in Eclipse Helios using Google App Engine and want
I'm building a website using a Wordpress theme The Travel Theme ( http://thetraveltheme.com/ ).
I'm an independent web designer/developer. Most of my work is building basic Wordpress websites

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.