Deploying ASA6 and using DSN-less connections...

Hi,

After much research and trial and error, I have come up with a method of
easily deploying ASA6 with my PowerBuilder 5 application (I would imagine
all would still work with higher versions as well) and also of connecting to
my ASA database without creating an ODBC Data Source (DSN).

I noticed that this topic is asked about frequently, but I was unable to
find a simple solution so I'd lke to contribute this one.

I have tested this method on my Windows 95, 98 and 2000 environments, with
complete success.

If you have any comments about my method, please pass them along.
______________________________________________________

1 - Deploy these files along with your application EXE (in the same
directory):

    DBODBC6.DLL
    RTENG6.EXE (use DBENG6.EXE instead if you have paid for the licence to
do so)
    DBLGEN6.DLL
    DBLIB6.DLL
    DBSERV6.DLL
    DBODTR6.DLL

2 - If ASA 6 is being used with PowerBuilder 5, the PBODB050.INI file MUST
contain an entry for [Adaptive Server Anywhere] with the same contents as
the
existing [Sybase SQL Anywhere] section.

    [Adaptive Server Anywhere]
    PBSyntax='WATCOM50_SYNTAX'
    PBDateTime='STANDARD_DATETIME'
    PBFunctions='WATCOM_FUNCTIONS'
    PBDefaultValues='autoincrement,current date,current time,current
timestamp,timestamp,null,user'
    PBDefaultCreate='YES'
    PBDefaultAlter='YES'
    PBDefaultExpressions='YES'
    DelimitIdentifier='NO'
    PBDateTimeInvalidInSearch='NO'
    PBTimeInvalidInSearch='YES'
    PBQualifierIsOwner='NO'
    PBSpecialDataTypes='WATCOM_SPECIALDATATYPES'
    IdentifierQuoteChar='"'
    PBSystemOwner='sys,dbo'
    PBUseProcOwner='YES'
    SQLSrvrTSName='YES'
    SQLSrvrTSQuote='YES'
    SQLSrvrTSDelimit='YES'
    ForeignKeyDeleteRule='Disallow if Dependent Rows Exist (RESTRICT),Delete
any Dependent Rows (CASCADE),Set Dependent Columns to NULL (SET NULL)'

3 - Create a function that just establishes an "ODBC Driver" pointing to
your ASA files:

For example, my function is called f_setup_sqlany6_odbc_driver(string
fas_odbc_driver_name)

RegistrySet("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC DRIVERS", &
 fas_odbc_driver_name, "Installed")

RegistrySet("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\"+fas_odbc_driver
_name, &
 "Driver", gstr_global_vars.s_app_run_directory+"DBODBC6.dll")
RegistrySet("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\"+fas_odbc_driver
_name, &
 "Setup", gstr_global_vars.s_app_run_directory+"DBODBC6.dll")

4 - Use something like this for your 'connect' coding:

    String ls_my_ODBC_driver_name = "Sybase_ASA6_for_MyApp"

    // Specify everything in the 'Connectstring' so an actual ODBC DSN is
not necessary
    // We still need to have the 'ODBC Driver' defined for the workstation,
though.

    Transaction ltr_temptrans
    ltr_temptrans = CREATE TRANSACTION
    ltr_temptrans.dbms = "ODBC"
    ltr_temptrans.dbparm = "Connectstring ="+&
            "'Driver="+ls_my_ODBC_driver_name+";UID=dba;PWD=pwd;"+&

"DatabaseFile="+gstr_global_vars.s_app_run_directory+"MyDB.DB;"+&
            "Start="+gstr_global_vars.s_app_run_directory+"RTENG6.EXE -Q -c
8m;"+&
            "AutoStop=yes',DisableBind = 1"
    //////////////////////////////////////////////////////////////////

    CONNECT USING ltr_temptrans;

    if ltr_temptrans.sqlcode = 0 then
        // All is good!
    else
        // Try to re-establish the ODBC Driver and CONNECT again
        f_setup_sqlany6_odbc_driver(ls_my_ODBC_driver_name)

        CONNECT USING ltr_temptrans;
    end if

    ///  This function displays the DB Error Message if applicable
    if f_db_error(ltr_temptrans) then
        // No need to continue
        RETURN
    else
        // All is good, keep going..
    end if
______________________________________________________

That's it!!!




0
Dave
2/12/2002 10:31:08 PM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

0 Replies
316 Views

Similar Articles

[PageSpeed] 10

Reply:

Similar Artilces:

Deploying ASA6 and using DSN-less connections... #2
Hi, After much research and trial and error, I have come up with a method of easily deploying ASA6 with my PowerBuilder 5 application (I would imagine all would still work with higher versions as well) and also of connecting to my ASA database without creating an ODBC Data Source (DSN). I noticed that this topic is asked about frequently, but I was unable to find a simple solution so I'd lke to contribute this one. I have tested this method on my Windows 95, 98 and 2000 environments, with complete success. If you have any comments about my method, please pass them along. ...

Can I use DSN less to connect database
Hi, Can I use DSN less to connect database, like connect to *.mdb? from LEO ...

How to connect DBClient using a DSN-less connection in a VB5 App
I have a VB5 app connecting to SLQ Anywhere without a data source name - no problem. I am changing the app to a multi-user environment using SLQ Anywhere Server & SQL Anywhere Client. I can connect with a DSN - no problem; the ODBC dialog screen comes up. I don't want to setup a DSN on all the machines in the office if I don't have to. We are running Novell (I think 3.1, maybe 4.0) Here is the code for the standalone version DSN-less- works fine. RDOConnect = "UID=rico;PWD=rico;DBF=" + DBPath + "\ricoapp.DB;DRIVER=Sybase SQL Anywhere 5.0;DSN=&#...

Database Connectivity ( DSN Less )
HI i have made a connection to MSSQL database with DSN . can we make a connection without DSN . thanks tan ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp If the ODBC driver allows you to specify all the connection parameters via DBParm, you can connect without a DSN. I have done it with ASA, but not MSSQL. "tan" <mrdragon13@yahoo.com> wrote in message news:#9rbXaRPBHA.150@forums.sybase.com... > HI > i have made a connection to MSSQL database with DSN . can we make a connection > without DSN...

Cannot connect to the database after deploying using aspnet_compiler
I've developed a asp.net app using Visual Web Developer 2005 Express. After tested ok in the Visual Web Developer, it is deployed by precompiing using: c:\windows\microsoft.net\framework\v2.0.50727\aspnet_compiler -v /test_src -p c:\vwd2005\test -u c:\test After creating a virtual directory for c:\test, I browsed to localhost/test/Default.aspx. The page is displayed ok, but fails on a function which required connection to the sql 2005 express database. Error: Cannot open database "Test" requested by the login. The login failed. Login failed for us...

how to connect to database using dsn and udl
Good day. I want to connect to an SQL db using . I Tried it using oledb, but it doesn't work. -- dim con as new oledb.oledbconnection() dim com as new oledb.oledbcommand() con.connectionstring = "dsn=exer4;uid=sa;password" com.connection = con con.open con.close -- Also, how to connect to db using udl? I created a udl file that connects to an sql db, located in the folder with the aspx pages. In vb.net, I use application.startuppath to locate the udl file, however in asp.net application.startuppath points to another location other than the page direct...

DSN Less connection using sql anywhere
Hi We have recently shifted our web pages and asp pages onto SBC webhosting. The problem is that we are using SQl Anywhere 5.5 database on our database server. Our various locations are accessing asp pages using SQL anywhere database. I have to setup ODBC connection to SBC site . Currently we are using the following script in asp pages: Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=WestSac;UID=DBA" Set cmd = Server.CreateObject("ADODB.Command") Could anyone help me how to setup DSN less connection using SQl anywhere. Thanks N...

How can I connect to an ASA6 DSN using ADO?
As sbj ...

Database Connection using DSN in asp.net
Hi, Iam developing an intranet web application in asp.net with SQL Server database. I have loaded .Net in a system ( which is in LAN)other than server. But the database resides in server. Now i want to connect the application to that server database thru DSN. (or if there is any other method for connection) . Its very urgent. Can anyone help me out of this problem. Thanks in advance. Cheers, VR.Chakravarthy.      Cheers,Chakri...

how to connect local access database using dsn
how to connect local access database using dsn Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=; See www.connectionstrings.com for more examples! If this post was useful to you, please mark it as answer. Thank you!...

How can I connect to an ASA6 DSN using ADO?
As sbj Here is a sample: <HTML> <HEAD> <TITLE>ADO Example</TITLE> </HEAD> <BODY> <% Set MyConn=Server.CreateObject("ADODB.Connection") MyConn.Open "DSN=asademo" Set RS=MyConn.Execute("SELECT * FROM Department") %> <table border=1> <tr> <% for i=0 to RS.Fields.Count -1 %> <TH> <%= RS(i).Name %> </TH> <% Next %> </TR> <% WHILE NOT RS.EOF %> <TR> <% for i=0 to RS.Fields.Count -1 %> <TD> <%= RS(i) %> </TD> <%...

how i make dsn less connection in powerbuilder 8
I want to connect database without dsn how can i do that, please send code for that A quick google search yielded: http://www-gatago.com/comp/soft-sys/powerbuilder/2432684.html Simply change the Driver= value to match the ODBC driver you want to use. pravin wrote: > I want to connect database without dsn how can i do that, > please send code for that -- Chris Keating Sybase Adaptive Server Anywhere Professional Version 8 ***************************************************************************** Sign up today for your copy of the SQL Anywhere Studio 9 ...

DSN less connection with powerbuilder 11.2
Can anyone please let me know to give DSNless connection with SQL Anywhere database in powerbuilder 11.2. It would be very helpful to me With thanks Polachan ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Polachan, The basic trick is to pass in the "DRIVER" argument in the connection string - the SQL Anywhere ODBC driver must still be present on the system. "DRIVER=SQL Anywhere 11;UID=dba;PWD=sql;ENG=MyEngine;..." Regards, POLACHAN wrote: > Can anyone please let me know to give DSNless con...

DSN less connection using Web.config file
Hi I have added name value pair for connection string in the Web.config file as shown below. <appSettings> <add key="EventCM_Database" value="Provier=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=E:\web\keydynamics\htdocs\_database\db.mdb" /> </appSettings> On my local environment if works file when the file is located within c:\Inetpub\wwwroot\Applicationname\ directory I attempt to access the database in the following manner and it works on my local environment. Dim dbConnection As System.Data.IDbConnection = N...

Web resources about - Deploying ASA6 and using DSN-less connections... - sybase.powerbuilder.database

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Sydney's beauty relies on its visual and physical connection to nature
Landowners, custodians and developers must collaborate to create a healthy environment, happy residents and a more productive city.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

10th person arrested in connection with Paris attacks
CNN 10th person arrested in connection with Paris attacks CNN (CNN) Belgian police have arrested a 10th person in connection with last month's ...

Should auld connections be forgot...
This environmental testing company has strict data-retention requirements and they go beyond the data, reports a pilot fish on the scene. "Per ...

'How To Get Away With Murder' Season 2 Spoilers: Annalise, Wes, Eve's Connection Teased
Here are some spoilers from the second half of "How to Get Away With Murder" season 2.

Resources last updated: 1/3/2016 10:07:46 AM