<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I tried the link (<A href=""><FONT
face="Times New Roman"
size=3>http://myobaustralia.custhelp.com/cgi-bin/myobaustralia.cfg/php/enduser/std_adp.php?p_faqid=30548</FONT></A>)
but that driver doesn't work with the data file of my customer (or any other
that I got my hands on!) I installed that driver on my development machine which
is Windows XP Pro, no other installation of MYOB.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I get a 'cannot find table' error on the code that
I was using on my client's machine (Windows PX Pro, MYOB Accounting Plus
v18):</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?php<BR># connect to a DSN "mydb" with a user
and password</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> <BR>$connect = odbc_connect("test","",
""); <BR>echo $connect . "<P>";<BR># query the users table for name
and surname <BR>$query = "SELECT * FROM Employees"; </FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR># perform the query <BR>$result = odbc_exec($connect, $query) or
die ("cannot find table"); </DIV>
<DIV> </DIV>
<DIV><BR># fetch the data from the database
<BR>while(odbc_fetch_row($result)){ <BR> $name =
odbc_result($result, 1); <BR> $surname = odbc_result($result,
2); <BR> print("$name $surname<br>\n"); <BR>}</DIV>
<DIV>?></DIV>
<DIV> </DIV>
<DIV>When getting the raw output of the $results variable, I get a boolean(NULL)
result. Does that mean the DSN isn't setup correctly?</DIV>
<DIV></FONT> </DIV>
<DIV><FONT face=Arial size=2><BR><FONT face=Arial>Kind regards, <BR>Daniel
Antonic <BR>Proprietor DCN Solutions <BR><BR>Mob: 0438 303 429 <BR>Web:
</FONT><A href="http://dcnsolutions.net/"><FONT
face=Arial>dcnsolutions.net</FONT></A></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=krichardson@viewdale.com.au
href="mailto:krichardson@viewdale.com.au">Kim Richardson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=phpwestoz@lists.linux.org.au
href="mailto:phpwestoz@lists.linux.org.au">PHP users in Western Australia (or
nearby)</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, May 06, 2009 2:03
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [PHPwestoz] MYOB ODBC
error</DIV>
<DIV><BR></DIV>I've done this previously before and from memory we had to get
a MYOB<BR>ODBC driver to create the DSN.<BR><BR>I think you can get it from
here.<BR><BR><A
href="http://myobaustralia.custhelp.com/cgi-bin/myobaustralia.cfg/php/enduser/std_adp.php?p_faqid=30548">http://myobaustralia.custhelp.com/cgi-bin/myobaustralia.cfg/php/enduser/std_adp.php?p_faqid=30548</A><BR><BR>Daniel
Antonic wrote:<BR>> Hello all<BR>> <BR>> I'm writting a program
that will interface a customer's MYOB database<BR>> file with her web site
so that people can pay online, and it is all<BR>> recorded in her MYOB file
immediately.<BR>> <BR>> MYOB Accounting V18 is running in Windows
XP Pro, I have set up a<BR>> System DSN, but PHP just cant see the
database. I got this snippet of<BR>> code from another web
site:<BR>> <BR>> <?php<BR>> # connect to a DSN "mydb" with a
user and password<BR>> <BR>> $connect = odbc_connect("test","",
""); <BR>> echo $connect . "<P>";<BR>> # query the users table for
name and surname <BR>> $query = "SELECT * FROM Employees"; <BR>><BR>>
# perform the query <BR>> $result = odbc_exec($connect, $query) or die
("cannot find table"); <BR>><BR>> # fetch the data from the database
<BR>> while(odbc_fetch_row($result)){ <BR>> $name =
odbc_result($result, 1); <BR>> $surname = odbc_result($result,
2); <BR>> print("$name $surname<br>\n"); <BR>>
}<BR>> <BR>> It fails at $result, I put in the DSN name, username
and password in<BR>> the odbc_connect() directive. I really need help on
this, please!<BR>><BR>> Kind regards,<BR>> Daniel Antonic<BR>>
Proprietor DCN Solutions<BR>><BR>> Mob: 0438 303 429<BR>> Web:
dcnsolutions.net <<A
href="http://dcnsolutions.net/">http://dcnsolutions.net/</A>><BR>>
------------------------------------------------------------------------<BR>><BR>>
_______________________________________________<BR>> PHPwestoz mailing
list<BR>> <A
href="mailto:PHPwestoz@lists.linux.org.au">PHPwestoz@lists.linux.org.au</A><BR>>
<A
href="http://lists.linux.org.au/listinfo/phpwestoz">http://lists.linux.org.au/listinfo/phpwestoz</A><BR>>
<BR><BR>-- <BR>---------------<BR>Kim Richardson<BR>Web Applications
Developer<BR>Viewdale IT<BR>Tel: 1300 799 516 - Fax: (07) 3319 8932<BR><A
href="http://www.ausnix.com.au">http://www.ausnix.com.au</A><BR><BR><BR>_______________________________________________<BR>PHPwestoz
mailing list<BR><A
href="mailto:PHPwestoz@lists.linux.org.au">PHPwestoz@lists.linux.org.au</A><BR><A
href="http://lists.linux.org.au/listinfo/phpwestoz">http://lists.linux.org.au/listinfo/phpwestoz</A><BR></BLOCKQUOTE></BODY></HTML>