If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Pervasive dsn-less connection problems

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-06, 09:56
jsoft jsoft is offline
Registered User
 
Join Date: Jun 2006
Posts: 1
Pervasive dsn-less connection problems

I'm trying to connect to a remote pervasive database from a php script using a dsn-less ODBC connection. It works when I use a DSN, but not when I try a dsn-less connection. Here's the connection string I'm trying:
$dsn2 = "DRIVER={Pervasive ODBC Client Interface};ServerName=jsoft.ca:1583;ServerDSN=DEMO ";

echo $thetable;

$connect = odbc_connect($dsn2, "", ""); // connect to DEMO database no userid or password

$query = "SELECT * from $thetable"; // set the query variable to contain the SQL you want to execute

$result = odbc_exec($connect, $query); // perform the query



// print out the entire resultset as HTML table (uncomment following line)

// odbc_result_all($result);

... And here's the error I'm getting:
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/pvswsample1_ODBC.php on line 63

If I use a DSN it works. Here's the string and odbc.ini for that:
$connect = odbc_connect("REMOTE_DEMO", "", ""); // connect to DEMODATA database no userid or password

odbc.ini:
[ODBC Data Sources]
REMOTE_DEMO=Pervasive ODBC Client Interface

[REMOTE_DEMO]
Driver=/usr/local/psql/lib/odbcci.so
Description=Pervasive ODBC Client Interface: jsoft.ca:1583/DEMO
ServerDSN=DEMO
ServerName=jsoft.ca:1583
UID=
PWD=


Any help would be greatly appreciated
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On