Results 1 to 2 of 2
  1. #1
    Goinfory is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jun 2015
    Posts
    1

    Problems with Database connections


    I am having problem with connecting to Database in hostforlife.eu. I do not know if it is my code that is giving the problem or my host provider that is giving the problem. I tried 2 different ways of coding to connect to database;

    Below is the working code:
    $hostname = "xxx.db.xxx.mysite.com";
    $username = "xxx";
    $dbname = "xxx";
    $password = "xxx";

    mysql_connect($hostname, $username, $password) OR DIE ("Unable to
    connect to database! Please try again later.");
    mysql_select_db($dbname);
    Below is the non-working code:
    define("DBHOST","xxx.db.xxx.mysite.com");
    define("DBNAME","xxx");
    define("DBUSER","xxx");
    define("DBPASS","xxx");

    mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
    mysql_select_db(DB_NAME) or die(mysql_error());
    Or is it because hostforlife can't use define function? Thanks guys.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am not aware of a Define() function in VBA. I would just follow the API offered by the host.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-30-2014, 11:55 AM
  2. DSN-less connections, how?
    By tpcolson in forum Access
    Replies: 6
    Last Post: 02-17-2014, 07:53 PM
  3. How many FE connections to BE are too many?
    By ItsMe in forum Database Design
    Replies: 3
    Last Post: 12-06-2013, 04:07 PM
  4. creating connections between forms
    By premis in forum Access
    Replies: 6
    Last Post: 03-29-2013, 01:21 PM
  5. Multiple connections to a single backend
    By shabbaranks in forum Access
    Replies: 1
    Last Post: 01-09-2012, 04:38 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
  •  
Other Forums: Microsoft Office Forums