Results 1 to 5 of 5

Thread: Unable to connect to the Pubs.mdf database file

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    108

    Red face Unable to connect to the Pubs.mdf database file

    Hi,

    I am using vb2005 to try to connect to the PUB.MDF database file. I copied the file into the same folder as the vb code files.

    I used the statement below as the sqlConnection:

    dim myConnection as SqlConnection = new _
    SqlConnection("server=(local);database=pubs;uid=sa;pwd=")

    When the program runs, there was a run time error and vb highlighted the line "myConnection.open()" and said that there was an error connecting to the database.

    How do I solve this problem?

    I did not set any password and userID to the database file. I tried removing the uid and pwd parameters but the error remains.
    Last edited by LiLo; Dec 8th, 2006 at 02:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width