Skip to main content

Hi,
Thanks to some good posts here I've figured out how to use the Maximizer odbc.

It works great for local things, but now I wonder if I can create a web based program that connects to Maximizer. I'd like to write this program in either PHP or ASP on a server that is always online (rather then the office computer that Maximizer is on which is turned off overnight).

I'm trying to extend Maximizer so employees can connect and update their availability. It would be ideal if they could do this 24/7.

Can it be done? Hints are appreciated.

Thanks!
Original Post

Replies sorted oldest to newest

Had a bit of a break from this project while it was delayed.

For some reason when I connect to MAximizer through ODBC, it connects fine, but then it can't perform a select statement. The error it gives me in Visual C++ is "Driver does not support this function".

Surely you can perform select statements with the Maximizer odbc???????

Any suggestions?
I have simplified it to the code below in Microsoft Visual C++. It is still giving me the same error ("Driver does not support this function"). I am using Max 7. I have confirmed that there is a user call MASTER and the password is control. It may be important to note that I can get information out of Maximizer with Access. So I know the DSN works, at least some of the time. NannyNetworkMaxDB uses the Max ODBC driver

I have tried changing ' "DSN=NannyNetworkMaxDB;Uid=MASTER;Pwd=control;", CDatabase::noOdbcDialog ' to NULL so that it asks me to select a DSN and enter the username and password. This also results the same error so I don't think the problem is with the connection string. I've also created another user in the Max Admin Program, which doesn't work either. It is still giving me the same error ("Driver does not support this function").

Lastly I have tried using the Persuasive ODBC Driver, but I get an error saying "Unable to open table: CLIENT. No such table or object.". This seems like more progress, but I'm not sure why the Persuasive driver can't find a table that does exist???

Anyways here is the code, any help would be hugely appreciated:



void CNannynetworkcppDlg::Test()
{
CString id, notes, sql;
CDatabase m_max;
m_max.OpenEx("DSN=NannyNetworkMaxDB;Uid=MASTER;Pwd=control;", CDatabase::noOdbcDialog);
CRecordset m_max_info(&m_max);
m_max_info.Open(CRecordset::snapshot,"SELECT * FROM CLIENT WHERE Record_Type = '2'");
while(!m_max_info.IsEOF()) {
MessageBox("select successful", "" , MB_OK);
}
m_max.Close();

}
>Surely you can perform select statements with the Maximizer
>odbc???????

Yes, you can.

>I have simplified it to the code below in Microsoft Visual C++. It is
>still giving me the same error

I can't help you with the VC++ syntax, but here's how it works using ADO in VBScript:

Option Explicit

Const adUseClient = 3
Const adOpenKeyset = 1
Const adLockOptimistic = 3

Dim con, rst

Set con = CreateObject("ADODB.Connection")
con.CursorLocation = adUseClient

con.Open "DSN=EsconaTutorial;UID=MASTER;PWD=control;"

Set rst = CreateObject("ADODB.Recordset")

rst.Open _
      "SELECT COUNT(*) AS n FROM CLIENT", _
      con, adOpenKeyset, adLockOptimistic
      
MsgBox rst("n"), vbOkOnly, "Query Result"

rst.Close
Set rst = Nothing
con.Close
Set con = Nothing


>Maybe the problem is the MFC exe file I'm creating uses DLLs???

The article you cited had to do with compiling VB code _into_ a DLL that was called from the Maximizer application itself. That particular code wouldn't work properly in a DLL, although the same code compiled into an EXE _would_ work, and that EXE certainly did use other DLLs.

I'm not sure what data access method you are trying to use; perhaps Maximizer ODBC doesn't like it. Try using ADO and see if that works.

>I'm not sure why the Persuasive driver can't find a table that does
>exist???

Pervasive ODBC uses different object names than Maximizer ODBC. The 'AMGR_Client' view in Pervasive ODBC corresponds to the 'CLIENT' table in Maximizer ODBC. Note, however, that using Pervasive ODBC has its own quirks....
Gord, thanks very much for you post. It cleared a few issues up for me. However, it still would not connect properly from a Visual C++ project. After much hair pulling, I've decided to change it to a completly web based program and can perform selects and updates with php.

Not sure why the VC++ wouldn't work, but I'm happy to finally be able to finish the project.

Thanks to all who helped.
Hi
I am very new to maximizer and have been given the task to connect my ecommerce site (built in php) to our maximizer Db. looking at the previous post from ccharp is it at all possible you could copy your php script which connects to max or some sort of example to give me a starting bloc!! any help would be much appreciated!!!
gord how do you do that?? is it hard to copy the script/coding and put it on the website?

quote:
Originally posted by Gord:
>the computer with maximizer on it would remain on

That will help a great deal. Wink

Now, if...

- the web server will be a different machine, and

- the two can communicate with each other over the Internet

...you might be interested in the PHP Extension for ODBTP:

http://odbtp.sourceforge.net

.
>how do you do that??

You install the ODBTP server component on the machine with the Maximizer database. You install the PHP Extension for ODBTP on the web server. When you use the ODBTP calls in your PHP script to send SQL statements to the ODBTP server, the ODBTP server component redirects them to the specified ODBC data source (i.e., a DSN for the Maximizer database) and returns the results to your PHP script.

>is it hard to copy the script/coding and put it on the website?

It is not particularly difficult, no. Obviously some familiarity with Maximizer ODBC, SQL, and PHP is required.

Add Reply

Post
LEGAL INFO
CONTACT US
Copyright 2007-2018 Advoco Solutions Ltd. All Rights Reserved.
×
×
×
×
Link copied to your clipboard.
×