First I used web9 and tried dsnless connection. The error I was getting was:
Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Driver does not support this function, SQL state IM001 in SQLConnect in D:\hshome\cnisvcs-\cni-test.com\dbtest.php on line 23
Please note that this particular error msg was produced on web2, as I already closed account on web9 and cannot reproduce it there. The message was persistent regardless what path to the db file I specified.
As a second attempt I was using my own account on web2. Each time I tried to setup DSN connection in CP I was getting the following:
Failed to add DSN
Unable to create ODBC data source COM error: Failed to set security info API error : The system cannot find the file specified. Time:Wed May 16 13:24:59 EDT 2007 Server IP: 204.10.107.232 Server name: JH-OUN7AM8B1DCF Parameters: SourceType=DBF&DSN=cnisvcs_aaa&Collate=&Description=&driver-name=Microsoft+Visual+FoxPro+Driver&Exclusive=&BackgroundFetch=&SourceDB=cni-test.com%5CAAA_esrpt_final.dbf&user-name=cnisvcs- H-Sphere Winbox version : 02.43 H-Sphere Winbox build : 779
Command: odbc-createdatasrc.asp
Part of the message refers to missing file. I tried all possible paths, relative, absolute, put the db file in acct root, to no avail.
DSN-less attempts on web2 were causing same error as listed above on web9.
Getting desperate I started looking for alternative ways to get the data out of the dbf file. I will be dealing with 2 or 3 files, each containing no more than 50 records, only reading. PHP dbase commands seemed an option. I managed to enable the dbase PHP extension on web2 and had positive results.
The client's site will be hosted on win23, so whatever I do ultimately has to work there. At first I tried to setup DSN connection in CP. Seemed to go thorough, no errors. However, I intentionally entered wrong path and there was no error either. This indicates that the CP does not check for the presence of the file in indicated location. Then I tried to access the file with the following command:
$dsn_name = "princet_a";
$connect = odbc_connect($dsn_name,"","");
Script executes for about two minutes and then sort of dies. It does not display any error, warning or any message that was generated by the script prior to the odbc_connect line.
I am afraid that this script causes some kind of major overhaul on the server. In the process of testing (last ninght between 1-3 am CT) there were times when my site stopped responding for minutes.
Next I tried with DSN-less connection string like this one:
$dsn_string = "{Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=D:\home\princeto\leoknows.com\AAA_esrpt_final.dbf;Exclusive=No;NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO;";
$connect = odbc_connect($dsn_string,"","");
I tried various combinations: without brackes around driver designation, without less relevant pieces like: null=no, collate, background fetch, tried adding UID=;PWD=;. Nothing worked, same behavior - script processed for quite awhile then timing with no error.
Finally I requested enabling dbase commands for this account. Ticket# LNT-98368-966. No response yet.
Please help.