Author Topic: ODBC for EXternal Access  (Read 4221 times)

0 Members and 1 Guest are viewing this topic.

Charlie Markwick

  • Member
  • **
  • Posts: 23
    • View Profile
ODBC for EXternal Access
« on: 2014-10-16 10:17:47 »
I want to make use of the T+ data file in order to create a simple interactive web page to search by keyword and display thumbnails and embed the path to the original image in a link.

I have T+ installed and running on our server which also IIS. The T+ data file is on the server too. I can't see any existing T+ ODBC set up on the server, do I have to create a new ODBC connection or is there an exsiting one I can locate and use?

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 938
    • View Profile
ODBC for EXternal Access
« Reply #1 on: 2014-10-16 11:52:39 »
TP is a 32 bit program, so if you're on a 64-bit machine, look for a 32-bit ODBC connection.
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

Charlie Markwick

  • Member
  • **
  • Posts: 23
    • View Profile
ODBC for EXternal Access
« Reply #2 on: 2014-10-17 02:50:28 »
Thanks for the speedy response. I have run c:\Windows\SysWOW64\odbcad32.exe but there is no specific reference to T+ MS:-



When I try and check the top two I get errors:-



The bottom one is used by Sophos.

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 938
    • View Profile
ODBC for EXternal Access
« Reply #3 on: 2014-10-17 03:41:06 »
I would have sworn that there was a TP specific data source, but as it turns out, I don't find any on my system either. It must be using the generic Access source.

Maybe you can temporarily turn on ODBC tracing and launch TP to see which username, password, etc, it is using to access the database, and then use those through a data source of your own? To see the database structure (if you don't have MS Access) I recommend MDB Viewer from www.alexnolan.net (it's free. In the File Open dialog, enter *.tpdb8 to find and open your database).

Several users in the past have made web applications that use their database and have written about it in the old newsgroups. If I remember correctly, a few even posted .asp or .net source code. If that might come in handy and you have newsreader software, see this post for a link to the newsgroup archives: http://forums.cerious.com/forum/index.php?id=1426. All info will pertain to TP v7 and earlier though, and there have been some major changes in the database format since.
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

Charlie Markwick

  • Member
  • **
  • Posts: 23
    • View Profile
ODBC for EXternal Access
« Reply #4 on: 2014-10-17 12:41:21 »
Thanks Daan

All very helpful. I do some more investigations and post the results. I do have access as it happens although I never use it but we have the MS Action Pack I tend to keep it installed. I shall in fact be using PHP. I will also post the code once it's up and running, not that it will be beautiful just functional!!

Charlie

Charlie Markwick

  • Member
  • **
  • Posts: 23
    • View Profile
ODBC for EXternal Access
« Reply #5 on: 2014-10-20 10:33:12 »
OK I've abandoned ODBC in favour of a DSNless connection it seems much easier. Here's some PHP code that establishes a PDO object:-

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

    $strDBPath = 'path to db file';
    // Remember: escape the backslashes & include trailing backslash eg: c:\\T+DBFiles\\
    $strDBName = 'name of db file';
    // Just the name of the database eg: ThumbsPlus.tpdb8
    $strFullName = $strDBPath . $strDBName;
    if (!file_exists($strFullName)) {
        die("Could not find database file.");
    }
    $strCon =
        'odbc:Driver={Microsoft Access Driver (*.mdb)};' .
        'Dbq=' . $strFullName;
    $objThumbs = new PDO($strCon);
?>

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

Sorry it looks kludgy but there's no code mark-up on this board. I'll post the whole project once it's finished.

NOTE: you need to have the access driver installed on your machine. If you have MS Office then you may well have this already. Otherwise get it [link=http://www.microsoft.com/en-us/download/details.aspx?id=13255]here[/link].

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 938
    • View Profile
ODBC for EXternal Access
« Reply #6 on: 2014-10-20 11:49:39 »
Very interesting - thanks for posting!
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

Charlie Markwick

  • Member
  • **
  • Posts: 23
    • View Profile
ODBC for EXternal Access
« Reply #7 on: 2014-10-21 04:04:34 »
Daan

is there any way of formatting code on this board

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 938
    • View Profile
ODBC for EXternal Access
« Reply #8 on: 2014-10-21 15:23:25 »
No, I don't think it is supported here.
I'm volunteering as a moderator - I do not work for Cerious Software, Inc.