DSN-less connection to SQL Anywhere 5.0 from VB 6.0

I am trying to connect to SQL Anywhere database using ADO in VB 6.0, but 
without using a specific DSN.  I have gotten it to work using a DSN, but am 
trying to provide everything the connection will need without using the 
DSN, as not all the computers this will run on will have the DSN.

Currently running this code to make connection to SQL Anywhere database 
using DSN:

Public adocnn As New ADODB.Connection
Sub Main()
    Dim adoRecordset As ADODB.Recordset
    Dim strCnn As String
    Dim adoCmd As ADODB.Command
    Set adoCmd = CreateObject("adodb.command")
    Set adocnn = CreateObject("adodb.connection")
    strCnn = "DSN=sqlOnyxOffline;uid=<userid>;pwd=<password>;"
    adocnn.ConnectionString = strCnn
    adocnn.Open
 
    With adoCmd
        .ActiveConnection = adocnn
        .CommandType = adCmdText
        .CommandText = "create table aaa (iId int)"
        .Execute
    End With
End Sub

Any suggestions will be appreciated.  Thank you.

Nick Timmerman
Programmer Analyst / DBA
Midmark Corporation
ntimmerman@midmark.com
0
Nick_Timmerman
3/8/2002 7:02:48 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

1 Replies
681 Views

Similar Articles

[PageSpeed] 46

Here is an example;

strCnn = "'Driver={Sybase SQL Anywhere
5.0};UID=<uid>;PWD=<pwd>;Databasename=<dbn>;EngineName=<eng>;start=dbclient.
exe -x tcpip';

/ck

<Nick_Timmerman> wrote in message
news:BC5C3DA8A3D3A6F80068A0A585256B76.0068A0BD85256B76@webforums...
> I am trying to connect to SQL Anywhere database using ADO in VB 6.0, but
> without using a specific DSN.  I have gotten it to work using a DSN, but
am
> trying to provide everything the connection will need without using the
> DSN, as not all the computers this will run on will have the DSN.
>
> Currently running this code to make connection to SQL Anywhere database
> using DSN:
>
> Public adocnn As New ADODB.Connection
> Sub Main()
>     Dim adoRecordset As ADODB.Recordset
>     Dim strCnn As String
>     Dim adoCmd As ADODB.Command
>     Set adoCmd = CreateObject("adodb.command")
>     Set adocnn = CreateObject("adodb.connection")
>     strCnn = "DSN=sqlOnyxOffline;uid=<userid>;pwd=<password>;"
>     adocnn.ConnectionString = strCnn
>     adocnn.Open
>
>     With adoCmd
>         .ActiveConnection = adocnn
>         .CommandType = adCmdText
>         .CommandText = "create table aaa (iId int)"
>         .Execute
>     End With
> End Sub
>
> Any suggestions will be appreciated.  Thank you.
>
> Nick Timmerman
> Programmer Analyst / DBA
> Midmark Corporation
> ntimmerman@midmark.com


0
Chris
3/8/2002 9:34:57 PM
Reply:

Similar Artilces:

SQL Anywhere 5.0 upgraded by ASA 6.0?, ASA 6.0 on Linux???
What is ASA? Is the newest version of Sybase SQL Anywhere 5.0? Can I directly upgrade a Database from SQL Anywhere 5.0 (windows NT) to ASA 6.0 or 7.0? Then, what is the database engine for Linux? or ASA 6.0 or 7.0 is multiplatform? Please, any help, I don't understand. P.S.: My SQL Anywhere 5.0 is boundled with DataEase Plus 2.77 conected via ODBC, will run with ASA on any platform? > What is ASA? Adaptive Server Anywhere. IE enchanced & considerably improved versions of old SQL Anywhere > Is the newest version of Sybase SQL Anywhere 5.0? No. Last versio...

SQL Anywhere 5.5.05 to SQL Anywhere Studio 6.0
Is the upgrade from 5.5.05 to Studio 6.0 a simple incremental upgrade? Can I complete this upgrade without code changes? It depends on the code. Sorry to be vague but that's the truth. It is described in great detail in the Help for ASA 6... ===== ASA New Features and Upgrading Guide CHAPTER 6. Upgrading From SQL Anywhere to Adaptive Server Anywhere This chapter describes upgrade procedures for users of SQL Anywhere Versions 5.0 and 5.5, and users of Watcom SQL 4.0. ===== Most ordinary SQL commands (SELECT, INSERT, UPDATE, DELETE) will NOT have to be changed at al...

Connect to SQL Anywhere 5.0 and MSSQL 6.5
Hi, Our PB 6.0 app. is running on the local workstation interfacing SQL Anywhere 5.0 DB on c: drive as temperary database and interfacing MSSQL 6.5 as primary data source. Data is upload from local SQL Anywhere 5.0 db to MSSQL 6.5 thru pipelines. Questions: 1. When connecting to MSSQL 6.5, Should we use ODBC SQL Server driver or PB native MS SQL 6.X driver ? We are using ODBC driver to connect to local SQL Anywhere now. 2. Where can we get the latest version of ODBC MS SQL Server driver or PB Native driver for MS SQL 6.5 ? 3. SQL Anywhere 5.0 allow mutliple column...

PB 6.5 and SQL Anywhere 5.0 connection failed.
Hello, I have a problem of PB6.5 and SQL Anywhere 5.0 ( which is buddled with PB 6.0). I wrote an applications with PB6.5 and created the database in SQL Anywhere 5.0. It works in my PC normally. However I cannot install the user's PC because the application cannot connect with the database though ODBC. I have setup the ODBC configuration with 32-bit ODBC administrator with is in Control Panel. And the setting is the same as the PC for development. I also installed the PB runtime files and another SQL anywhere stand alone server to user's PC. The user's PC is instal...

PB 6.5 / SQL Anywhere Studio 6.0 (ASA) connectivity
I can't get PB to see a ASA 6.0 network server either from the desktop or as an exe. I've seen several messages that imply that because PB6.5 was released before ASA 6.0, there is a need to apply a patch (PB6.5.1). I've done this and still have the same problems. Can somebody confirm that it is in fact possible to connect the PB 6.5.1 desktop to an ASA network server and similarly the exe. If, it can be done then I'll keep at it, otherwise I'll happily accept any alternative suggestions. BTW, I am able to connect to the network server using ISQL with no probl...

Connection of PB 6.0 to SQL Server 7.0 & Version B/W PB 6.0 and PB 7.0
Can anyone tell me about connecting PB 6.0 to SQL Server 7.0. Please remember we are not planning to upgrade both software. When I was trying to connect PB 6.0 to SQL Server 7.0, error occurred " SQLSTAT 1003". OS=NT 4.0 Server PB=6.0 Enterprise Edition SQL SERVER=7.0 Corporate Edition I also want to know the versions between PB 6.0 to PB 7.0 If your are using the ODBC, which I assume you are, include Disablebind=1 in your DBParm. If your deployment environment is also NT, you will have to turn SQLSPY=1 using PFC services. Autocommit=FALSE and SetTransObject() ra...

Help me about connecting PB 6.0 to SQL Server 7.0 & Versions B/W PB 6.0 and PB 7.0
Can anyone tell me about connecting PB 6.0 to SQL Server 7.0. Please remember we are not planning to upgrade both software. When I was trying to connect PB 6.0 to SQL Server 7.0, error occurred " SQLSTAT 1003". OS=NT 4.0 Server PB=6.0 Enterprise Edition SQL SERVER=7.0 Corporate Edition I also want to know the versions between PB 6.0 to PB 7.0 I don't believe this is going to be possible without at least upgrading to the latest maintenance release of 6.x. On Mon, 23 Aug 1999 00:59:56 -0700, in powersoft.public.powerbuilder.database Abdul Lateef <abdul_lat...

WARNING: Connections to SQL Anywhere 5.5 or ASA 6.0 no longer works properly after applying last patches !!
We are using PowerBuilder 5.0.04 to connect to SQL Anywhere 5.5 and ASA 6.0 databases. After applying the last ASA patch (6.0.3) on my PC, it no longer works properly. In the database painter and whenever I access an ASA database, all the table names appears in lowercase (they previously appeared in uppercase) and I can no longer edit or view the indexes. In SQL central, anything is still OK. The problem only happens in Powerbuilder. So, I suppose it's related to the PB/ODBC interface... Perhaps I need to add something in the PBODB050.INI file ... but what ? The very sam...

Netware 5.0+Groupwise 6.0 -->> Netware 6.0+Groupwise 6.5
Hi. We've got a Netware 5.0 server running Groupwise 6.0 and we would like to upgrade it to Netware 6.0 with Groupwise 6.5. What's the safest way of doing this? We've got a spare server where we can dump things temporarily. Should we upgrade Groupwise first or Netware? Thanks... Scott Le Brun Computer Operations Co-ordinator Mount Scopus Memorial College slebrun@no-spam.scopus.vic.edu.au: > Should we upgrade Groupwise first or Netware? Personally, I'd upgrade Netware first, make sure GW works in it's current config and then upgrade GW....

Replication between SQL Server 11.0.2 and SQL Anywhere 5.5.0.3
Does anyone know if exists some document with the details on Replication between Sybase SQL Server 11.0.2 and SQL Anywhere 5.5.0.3 using Replication Server 11.0.3. I�m having some troubles with this configuration and I�m wondering if I�m doing something wrong. Thanks in advance. ...

Triggers in SQL Anywhere 5.5.0 and PowerBuilder 5.0.03
Hi: I'm trying to get a series of triggers working, but am having lots of difficulties. Initially, the following trigger did not update the 'product' table on an insert. create trigger ti_inventory after insert on inventory referencing new as new_inventory for each row begin update product set product.current_in_stock = product.current_in_stock + new_inventory.qty_new + new_inventory.qty_used_excl + new_inventory.qty_used_good + new_inventory.qty_used_poor where product.product_code = new_inventory.product_code end; I tried to put other commands into the t...

Upgrade SQL Anywhere 5.0 to SQL Anywhere 9.0
Does anyone know of any scripts that can be used to prevent DB errors when upgrading a V5.0 database to a V9.0 environment? What error messages are you receiving? <fd1smith> wrote in message news:3f7839bd.7f74.846930886@sybase.com... > Does anyone know of any scripts that can be used to prevent > DB errors when upgrading a V5.0 database to a V9.0 > environment? ...

Upgrading 4.0 to 5.0 then 6.0 or go straight to 6.0
Hi All, I think the subject speaks for itself Thanks in advance Mustafa You should have no trouble going straight to 6 from 4. Once you do this, go back and get rid of the obsolete function calls. -- Regards, Millard[TeamPowersoft] -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ mf3@gatesys.com Co-Author of PowerBuilder 5.0: Object Oriented Design and Development McGraw-Hill, ISBN 0-07-024469-3 Co-Author of PFC Professional Reference (Block, Brown, Gasin, Green & Tauber) McGraw-Hill, 0-07-913267-7 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...

No Connect with FF 2.0.0.5 and TB 2.0.0.5
Name: Matze Email: infoatpc-scenedotnet Product: Firefox Summary: No Connect with FF 2.0.0.5 and TB 2.0.0.5 Comments: Hello, I have problems with Firefox 2.0.0.5 and Thunderbird. As soon as this version is not installed comes I any longer into Internet. No connection is indicated with both. 2.0.0.4 runs without problems up to the update on 0.5 Does someone know somewhat about an error?? MfG Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 ...

Web resources about - DSN-less connection to SQL Anywhere 5.0 from VB 6.0 - sybase.sqlanywhere.general

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
If you send more email, you might make more money. Then again, you might destroy your reputation and revenue stream. Here's how to know what ...

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 ...

MOTHER’S DAY: Facebook Examines Connections Between Moms, Kids
With Mother’s Day on the calendar this coming Sunday, Facebook examined the relationships between mothers and their children on the social network, ...

Half of data connections by top 500 Android apps are 'covert' with no effect on user experience
Researchers at the Massachusetts Institute of Technology have discovered that half of the communications connections established by the top free ...

The Direct Connection
... And the people reading my words respond back to me with words of their own. The technology that allows this is powerful but this direct connection ...

Is There A Connection Between Patrick Murphy's Over-The-Top Corruption And His Campaign Emails?
The DCCC may be stupid or even very stupid (as well as utterly incompetent) but their e-mail strategy is very well-planned out. Their overarching ...

Cross-cultural Connections and Exchange: international study is more important than ever
... And, as a minority of ill-intentioned individuals and groups do their best to create divides, we need citizens equipped to create connections ...

Be Goofy, Smile At Your Baby: Protection Begins with Connection, Pediatrician Says
VideoPart 3 of a series Andrew Garner wears silly ties and finds it easy to make a goofy face. These are valuable tools for charming the babies ...

Mali arrests 2 in connection with deadly hotel attack
Mali arrests 2 in connection with deadly hotel attack

Resources last updated: 12/3/2015 7:54:24 AM