G'day! I am trying to access data in a Pervasive database which is of quite an old version, not sure which, but using the Pervasive Software ODBC-32 driver, version 2.04.02.10, which comes with the application I am trying to share data with, Pastel Partner 5. I am running PHP 4.3 on Windows 2000 Professional with all the latest patches - Windows, that is.
I have created two DSN's, one for Pervasive, and one for MS Access. I can connect to MS Access from my PHP script, add, manipulate and delete data, etc, and I ncan connect to Pervasive from Access using the DSN I created form that purpose, and add, delete, update data and so on. However, when I attempt to connect to Pervasive from my PHP script using the same DSN, no joy. All I get is "Warning: SQL error: [Pervasive Software][ODBC Interface][Pervasive Software SQL Engine]General error., SQL state S1000 in SQLConnect in c:\inetpub\wwwroot\nettsis\includes\import\pastelodbc.php on line 9". I have set logging on in the ODBC thingie, but it is meaningless to me: php 714-5d8 ENTER SQLAllocEnv HENV * 00B06EF8 php 714-5d8 EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS) HENV * 0x00B06EF8 ( 0x009414f0) php 714-5d8 ENTER SQLAllocConnect HENV 009414F0 HDBC * 00B06EFC php 714-5d8 EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS) HENV 009414F0 HDBC * 0x00B06EFC ( 0x00941598) php 714-5d8 ENTER SQLConnectW HDBC 00941598 WCHAR * 0x009416A0 [ -3] "GruffTrading\ 0" SWORD -3 WCHAR * 0x1F7C4AA0 [ -3] "******\ 0" SWORD -3 WCHAR * 0x1F7C4AA0 [ -3] "******\ 0" SWORD -3 php 714-5d8 EXIT SQLConnectW with return code -1 (SQL_ERROR) HDBC 00941598 WCHAR * 0x009416A0 [ -3] "GruffTrading\ 0" SWORD -3 WCHAR * 0x1F7C4AA0 [ -3] "******\ 0" SWORD -3 WCHAR * 0x1F7C4AA0 [ -3] "******\ 0" SWORD -3 DIAG [S1000] [Pervasive Software][ODBC Interface][Pervasive Software SQL Engine]General error. (802) php 714-5d8 ENTER SQLErrorW HENV 009414F0 HDBC 00941598 HSTMT 00000000 WCHAR * 0x0012F328 (NYI) SDWORD * 0x0012F370 WCHAR * 0x0012EF28 SWORD 511 SWORD * 0x0012F36E php 714-5d8 EXIT SQLErrorW with return code 0 (SQL_SUCCESS) HENV 009414F0 HDBC 00941598 HSTMT 00000000 WCHAR * 0x0012F328 (NYI) SDWORD * 0x0012F370 (802) WCHAR * 0x0012EF28 [ 81] "[Pervasive Software][ODBC Interface][Per" SWORD 511 SWORD * 0x0012F36E (81) php 714-5d8 ENTER SQLFreeConnect HDBC 00941598 php 714-5d8 EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS) HDBC 00941598 The relevant part of my PHP Code is as follows: $dsn = "GruffTrading"; // Datasource $dsu = ""; // User $dsp = ""; // Password if(!$odbclink = odbc_connect($dsn,$dsu,$dsp)) die("Unable to connect to Data Source $dsn<br>".odbc_error().": ".odbc_errormsg()); "odbc_pconnect" behaves the same. Any ideas, anyone? Cheers, William. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php