Results 1 to 3 of 3

Thread: data source nameing

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    4

    data source nameing

    I have written my first app using a database. The connection works fine on all pc's it's loaded on but one. The PCs all have the same load so at first I thought it was permissions.
    the error is "...error occurred while establishing a connection to SQL server ..... error:26..."
    Now I am suspecting that it is my data source name.
    Is there a way to automatically name the datasource, if that is my problem.
    I've added users and changed permissions in my security tab under properties but no luck.
    Again this is the first app I have using a database and honestly I really do not know what i'm doing.


    Public m_cn2 As New SqlConnection()
    Public m_cn2mdfPath As String = "C:\UCAL\WatchdogPCRevison.mdf"
    Public m_DA2_T1 As SqlDataAdapter
    Public m_CB2_T1 As SqlCommandBuilder
    Public m_DataTable2_T1 As New DataTable
    Public m_rowPosition2_T1 As Integer = 0
    Public m_drNewRow2_T1 As DataRow = m_DataTable2_T1.NewRow

    m_cn2.ConnectionString = "Data Source=.\SQLEXPRESS; AttachDbFilename = " & _
    m_cn2mdfPath & ";Integrated Security=True; Connect Timeout=30;" & _
    "User Instance=True"


    Any help would be appreciated

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: data source nameing

    Check to make sure that SQLServer Express has been installed... AND that the default named instance is correct... what you left out in the error message was the next sentence... "The server was not found or was not accessible." ... meaning, it couldn't find the instance running at ".\SQLEXPRESS" ... which means either 1) it's not running, 2) not installed, or 3) named something other than SQLExpress

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    4

    Re: data source nameing

    Sorry about that, I've attached a screenshot of the error.
    I've changed it to ".\SDCO" and after a bit of playing was able to get it to work. Is there a way to capture the actual name in a string?

    Name:  connection to sql error at rawsonville gauge and layout pc.gif
Views: 81
Size:  23.0 KB

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