Jump to content

Alteczen

Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by Alteczen

  1. I'm trying to connect to a MS Access database that uses a workgroup file for security (.mdw).  I'm using the ADODB class with a DSN-less connection:

     

    My code is:

     

    include('adodb5\adodb.inc.php'); 
    $db = 'path/to/db.mde';
    $wg = 'path/to/dbSecurity.mdw';
    $user = 'bob';
    $pass = 'joe';
    
    $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$db;SystemDB=$wg;Uid=$user;Pwd=$pass;";
    $conn = ADONewConnection('access');
    $conn->debug = true;
    
    $conn->Connect($dsn) or die("Connection Failed");
    

     

    And my response:

    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Not a valid account name or password., SQL state 08004 in SQLConnect in C:\wamp\www\gc\adodb5\drivers\adodb-odbc.inc.php on line 60
    Connection Failed.
    

     

    I'm looking for help from someone who has experience connecting to an Access db that uses a workgroup file for security.  I've been through pages of Google results with nothing concrete that has worked. 

     

    The response mentions "Not a valid account name or password".  But I'm 99% sure the user/pass is correct.  I'm hoping there is just an issue with my $dsn string.  If I change the paths to the .mde or .mdw files to something completely wrong I get the same response - thus it's possible that it's not choking on the user/pass combo.

    I'd love to use a different database but it's not an option.  The database comes from another company and it's what I have to work with.

     

    Thanks in advance for any tips or help you can provide!

  2. I'm using a loop to loop through images that I need to bump up next to each other such that there is no whitespace between them.  The loop puts the code segment on it's own line and it's causing a small whitespace to appear.  How can I force the loop to put the generated code without adding the line break?

    Example of how my code is:

    while(true){
      $this->show("<img src=\"test.jpg\" />");
    }

    so it prints out:

    <img src="test.jpg" />
    <img src="test.jpg" />
    <img src="test.jpg" />

    when i need it to print:

    <img src="test.jpg" /><img src="test.jpg" /><img src="test.jpg" />

    Thanks for help...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.