Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PSQL2000 ODBC Connection

Status
Not open for further replies.

ArnaudAbadie

Programmer
Mar 14, 2001
43
FR
Hi all,

I made a little programm in Borland C++ that links to a PSQL2000 Database and did some Sql queries.
To do so, I create an ODBC Connection. It's perfect when I use it with just one Database (located by its DDF files and its DSN Engine I presume).
But how can I make my program access to others databases that are located on the same serveur but on different locations.
Let say:
1° location \\MY_SERVER\DATABASE\001\FILE.DDF
2° location \\MY_SERVER\DATABASE\002\FILE.DDF

I made an old program that used the ODBC 2.04 and I used the software\ODBC\ODBC.INI reg entry in that time.

What's the equivalent now with PSQL2000i SP4 ?

Thank you in adavnce


 
You can do this by specifying the database name on the select to the second DB. (This is not the ODBC Name, but the Database Name from Pervasive). To ensure that you have the correct name, right click on the DB in PCC, select Properties, and look at the name in the drop down box. That is the name you use.

SELECT * From Customers c1 INNER JOIN MyDB2.Customers c2 ON
C1.ID = C2.ID
WHERE C1.Last_Order <> C2.Last_Order
 
Hello,

I think you miss uderstand what I want to know. That means that my explanation were not clear enougth...

When I click on the Pervasive.SQL2000i Engines, then Databases, then right-click on my Database called GESCOM: I can see that the DBName (that have been created at the creation of my ODBC entry. It's in that DBName that you specify the location of my database.
Now suppose that my database called GESCOM has a DBName called GESCOM001 (its FILE.DDF is located at K:\\MY_SERVER\MY_DIR001). Ok ?
Lets consider that I also have another database witch FILE.DDF is located at K:\\MY_SERVER\MY_DIR002.
How can I access my new DBNames property in order specify a new DDF location?


To make a summary:
1)I have two societies with same FILE.DDF spec.
2) What simply change is the location of the files and values...

In old ODBC version (2.04) I used to specify all that in the DDF PATH (it could be acced easely in the Registry).

Need help. Thank you in advance
 
Hi,

I find something interesting here in that forum.
I can do what I intend to do using ADO.
Provider=MSDASQL.1;Persist Security Info=False;Data Source=GESCOM;Extended Properties=&quot;DSN=GESCOM;ServerName=SERVDEV.1583;ServerDSN=GESCOM001;ArrayFetchOn=1;ArrayBufferSize=8;TransportHint=TCP;DecimalSymbol=.;&quot;

Doing that, I just have to change ServerDSN name: GESCOM001 for society 001 and so on...
My question is now: Can I do the same using ODBC?
 
In the Pervasive SQL Control Center, select the correct Engine, right click on Configuration and select Maintain Named Database. You can change the properties of the database there.
 
OK,

But my problem is: how can I do it dynamically by program.
Typicaly with Borland C++5 ?
How can I access that Dictionnary Location property by program ? I found any trace of that entry in the registry
 
If you are using the PDAC components you can use that to change the database name location. You can also use DTI or DTO to change them as well.
Check out the Pervasive site.
mirtheil@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top