Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tizer 170 posts 201 karma points
    Jul 02, 2010 @ 02:39
    Tizer
    0

    Connection String Help

    OK - I have moved servers and cannot figure out the connection string to use for umbraco.

    This is their KB article on the matter:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Please use the following connection string on our Windows 2008 servers to connect to the local MSSQL service:

    "Driver={SQL Server Native Client 10.0};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"


    Another method is to use the Provider= line like so:

    "Provider=SQLOLEDB;Data Source=myServerAddress;UID=myUsername; PWD=myPassword; database=myDataBase;"

    Where:

    myDataBase and myUsername and myPassword are what you've already specified in the control panel under MSSQL databases. myServerAddress can be 'localhost' or you may need to specify '.\SQLEXPRESS'


    Lastly, if you are not sure how to use that in context of the code, you may use this sample code:

    Set strConnString=Server.CreateObject("ADODB.CONNECTION")
    connect = "Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;UID=USERNAME; PWD=PASSWORD; database=DB;"
    strConnString.ConnectionString = connect
    strConnString.Open
    These are the sources:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This is my original string
    <add key="umbracoDbDSN" value="server=10.100.1.100;database=dbumbraco;user id=dbsite;password=dbsite" />

    I have tried the following with the articles above

    <add key="umbracoDbDSN" value="server=.\SQLEXPRESS;database=dbumbraco;user id=dbsite;password=pass" />

    <add key="umbracoDbDSN" value="server=.\SQLEXPRESS;user id=dbsite;password=pas" />

    <add key="umbracoDbDSN" value="server=localhost;database=dbumbraco;user id=dbsite;password=pass" />

    <add key="umbracoDbDSN" value="server=localhost;user id=dbsite;password=pass" />
    So now I'm totally confused 
    What should I use? It doesn't look normal to me
  • Gerty Engrie 130 posts 490 karma points c-trib
    Jul 02, 2010 @ 07:09
    Gerty Engrie
    0

    Hi Tye,

    If you restored the database on the new server, first check if your user has enough rights. Server can also be an ip like in your original connectionstring, it does necessarily need to be localhost or .\SQLEXPRESS, it depends on your server settings. If you restored your database than your password and userid would probably remain the same, so you probably want to change that too then in your new connectionstring.

    everything between brackets needs to be replaced with your servervalue (including the brackets itself)

    <add key="umbracoDbDSN" value="server=[your server name or ip];database=[your database name];user id=[user id with rights to your database];password=[password of the user id]" /> 

    good luck!

  • Tizer 170 posts 201 karma points
    Jul 02, 2010 @ 09:16
    Tizer
    0

    Perfect Gerty - thanks very much :)

     

Please Sign in or register to post replies

Write your reply to:

Draft