views:

59

answers:

3

What I want is a Powerbuilder application that runs on Windows that runs from a CD (or some other external disk) that can read from an ASA database whose file is located on the same disk. But I want to do so without deploying the ODBC or OLEDB drivers. That is, I do not want to have to copy the driver files to the client's hard disk or add any registry entries. Is this possible?

In the Powerbuilder and ASA documentation they mention something about "embedded database connections" and supposedly you can specify the executable for the database server in the connection string. But that was no help.

+1  A: 

When you attempt to connect to a database and "ODBC" is specified for the DBMS property of the transaction object, PowerBuilder is going to want to start loading drivers and looking to an ODBC datasource for the driver's info.

The only thing I can think to try, is to create all the registry entries at run time and point them to the driver files and the .db file on the CD. You might be able to make things easier with a file based datasource on the CD already, but you'll still need to create registry entries to setup the driver details. Then you can remove all those entries when you disconnect/close the application. I don't think you can do this completely without registry entries.

Mike
A: 

Hi,

Since you aren't getting much feedback I thought I'd offer this. I've done this with MS Access, but MS Access is much easier to connect to and most Windows PC's are able to connect via File based DSN. You definitely want to avoid ODBC if at all possible look for File based DSN in ASA, but because it is more of a full database engine I doubt it is possible without ODBC and setting up ODBC via Registry Entries is possible but no fun at all especially if your clients are running different versions of Windows.

Here is the connect string I used for something similar but MS Access. I chose Access for this exact reason, it was for a RPG program and I wanted a database but didn't want to mess with ODBC.

// // Sample: "Connectstring='Driver={Microsoft Access Driver (*.mdb)};UID=abc;PWD=123; Dbq=C:\Program Files\Mafia Manager\mm.mdb; Exclusive=1;'" //

DisplacedGuy
Thanks. I just tried adapting that connect string. Didn't work.
YWE
If you are tied to ASA then the solution will probably be relatively difficult. If you study how ODBC works (not fun), in particular the registry entries for setting up the actual drivers and then different registry entries for making the DSN you can make it work via code or an installation program. I'd try finding a install program that looks at your machine before and after installation of the drivers and DSN setup and have it generate a "delta" for which you use as a basis for what needs to be done. Not what you were looking for but I've been down this road too and I feel for you.
DisplacedGuy
A: 

You do have to deploy the ODBC driver, that's how PB talks to SQL Anywhere. You dont have to create a DNS entry though, you can usr a DNSless connection.

http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForSybaseSQLAnywhere

Bruce Armstrong