Results 1 to 12 of 12

Thread: [2005] Connection

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    [2005] Connection

    im connecting 2 laptops through cross connection cord, im wondering what connection string i should be using to access the SQL database on one laptop from the other one, basically,, client -> server accessing. Thanks! im using VB 05 and MS SQL 05 Express tytyty

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [2005] Connection

    I would check out http://www.connectionstrings.com/ first ...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Connection

    can anyone brief me on what i should remember when using cross connection lan cable for connecting 2 laptops client -> server thanks

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] Connection

    It doesnt matter where in your network or workgroup your databas is, you still need proper access to its location and the proper connectionstring.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Connection

    so if i want to connect to the other laptop's instance "Aerialz666\Thesis2" and the database name is "FinalDB" what connection string should i use? im not really sure tx

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] Connection

    You would include the server name (computer name) and database name, plus any logon credientials. If you click the link and go to connectionstrings.com you will find the cs you need.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Connection

    Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; <-- this one is what i assume the right one, but i dont have my other laptop now so i cant try it, can this work?

    Data Source = Aerialz666\Thesis2;Initial Catalog=FinalDB;User ID = xxxx;password=xxxx; <-- is this right? can it connect to the other computer and access the DB?
    Last edited by RobDog888; Jul 16th, 2007 at 01:04 AM. Reason: removed login credientials for safty.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] Connection

    If you have given the logon account that is passed in the connectionstring permissions to connect to your sql db then the first one should be it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    Re: [2005] Connection

    I think that should do it. Like Rob said, your username must have a permission to connect. Also, just remember that SQL Server 2005 Express disabled TCP/IP connection on default. You must enable it before.
    Check my Blog at VB Corner,Component Crafts

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Connection

    Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.
    Are you using SQL Server 2005 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server 2005 Express installation resides.


    since im using SQL Express 05, do i need to add a "\SQLEXPRESS" after my instance? assuming my instance name is Aerialz666\Thesis2 ? ..

    making it Aerialz666\Thesis2\SQLEXPRESS ? trhanks

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    Re: [2005] Connection

    btw, when i installed SQL express, it had a defaul user name of "sa" and then it allowed me to input my own password so is that the login account that has a persmission? thanks im not really good at this..

  12. #12
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    Re: [2005] Connection

    since im using SQL Express 05, do i need to add a "\SQLEXPRESS" after my instance? assuming my instance name is Aerialz666\Thesis2 ? ..
    Yes. It should named "<your computername>\SQLEXPRESS".

    btw, when i installed SQL express, it had a defaul user name of "sa" and then it allowed me to input my own password so is that the login account that has a persmission?
    You can also create additional account. I don't suggest you to use "sa" account for acessing your server. To create another user, you should install SQL Server 2005 Management Express. It can be download for free in this site
    Check my Blog at VB Corner,Component Crafts

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