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 > ODBC Connection from JavaScript

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-04, 09:40
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
ODBC Connection from JavaScript

Hi All,

I'm trying to establish a connection to Pervasive SQL 7 from JavaScript, but I keep getting the following error:

[Pervasive Software][ODBC Interface][Pervasive Software SQL Engine]General Error

The same connection string was used from other application and it did work.

Any clue on this? What special considerations should be taken when dealing with JavaScript?

Thanks in advance,

Ignacio
Reply With Quote
  #2 (permalink)  
Old 12-27-04, 10:55
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
What's the connection string? Are you pointing to local or remote data? If it's remote, make sure that the lcoal machine (and the web server) has rights on the remote machine.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 12-27-04, 18:04
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
Well, the connection string is working properly when used from another application and it has no problem. I'm sorry, but for privacy reasons I cannot publish it here. The target tables are in network drive, and the current user is and admin with full privileges.

The main thing here seems to be related to JavaScript because other applications can use the connection string and pull data successfully, but I'm not sure how or why js behaves like that. The message from pervasive is not very clear, besides.

Any other clue?

Thanks,

Ignacio
Reply With Quote
  #4 (permalink)  
Old 12-27-04, 19:39
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
If you can't post the actual connection string, then post a fake connection string that uses the same structure. FOr example are you using something like:
DSN=DEMODATA
or
Driver={Pervasive ODBC Engine Interface};DBQ=DEMDOATA
or
Driver={Pervasive ODBC Client Interface};ServerName=Server;ServerDSN=Demodata

While we're on the topic, does it fail to all datasources? If the exact same connection string is working from other applications on the exact same machine, then there's something that's not specifically Pervasive related and is probably permissions related.
Since the data is remote, are you using a Named Database or a path in the connection string? If you're using a path, is it a mapped drive or UNC? Have you tried the other (if using mapped, try UNC and vice versa). In most web servers, the default user (especially IIS) does not have access to mapped drives. The currently logged in user in most cases will not have any effect on the user being used by a web server.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #5 (permalink)  
Old 12-27-04, 21:11
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
At this moment I don't have the "skeleton" for the connection string, but it certainly looks like this one:

Driver={Pervasive ODBC Client Interface};ServerName=Server;ServerDSN=Demodata

Tomorrow I'll post the correct connection string.

Now, I'm not using a web server. It's just a plain html page from a client machine using javascript and an ActiveX component to pull data from the tables. Using this method, it's always the same user connecting to the network share, so no permission conflicts can occur even if using the connection string from different applications. I'm using a path in the connection string with a mapped drive. I will try switching to UNC and see if that helps.

Thanks for the help, I'll let you know how it works.

Ignacio
Reply With Quote
  #6 (permalink)  
Old 12-27-04, 23:27
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
When you post the correct connection string, also post the actual version of the Pervasive ODBC driver
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #7 (permalink)  
Old 12-29-04, 10:36
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
Here is the kind of connection string I'm using:

DRIVER={Pervasive Software ODBC-32};DATAPATH=h:\dat;UID=;PWD=;DDFPATH=h:\ddf;BOB=; NullEnabled=no;FeaturesUsed=no;LoginScript=;Access Friendly=no;DateFormat=;

The driver version is the following:

2.50.02.02

Thanks,

Ignacio
Reply With Quote
  #8 (permalink)  
Old 01-02-05, 09:53
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
First, have you ever seen a client side Javascript connection to a database (any database) work? From what I'm finding, Javascript is client side only and cannot access a database. Server side javascript can access a database. How about posting your code so other's can see how your doing it?
Also, is there any way you can upgrade? Pervasive.SQL 7 is old and unsupported. Pervasive.SQL V8 is the current version (it's actually two major versions newer). Also, if you can't upgrade, you should at least update to the latest service pack for P.SQL7. The ODBC 2.5x was not thread safe until about version 2.54.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #9 (permalink)  
Old 01-03-05, 13:29
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
I should have mentioned that I'm using an ActiveX component which is declared using the <object></object> tag. After that, I use javascript to pass parameters to the declared object. Among the required parameters are the Connection String and the SQL statement or query. In this way, the component is the one that access the database, but using javascript to gather the required parameters. This is why I don't see what's causing the error when trying to load data from pervasive tables.

I will suggest my client to at least apply the latest service pack and see if that works.

Any other thoughts are very welcome.

Ignacio
Reply With Quote
  #10 (permalink)  
Old 01-03-05, 15:44
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Can you use that ActiveX from a different environment (VB/Delphi/ASP)? Does it work there
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #11 (permalink)  
Old 01-06-05, 12:02
IgnacioH IgnacioH is offline
Registered User
 
Join Date: Dec 2004
Posts: 9
This issue has been solved by recreating the connection string. I suppose the original had something wrong. On the other hand, the network OS is Netware, which is not allowing relative paths.

There is an additional issue, but I'll open a new thread for it.

Thanks a lot for all the help.

Ignacio
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