Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to connect to a database with rdo connection
Message
De
25/01/1999 09:50:59
 
 
À
23/01/1999 06:57:49
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00179360
Message ID:
00179800
Vues:
22
Hi,

It's a sample to rapidly create an rdo connection using odbc when having the DSN string.
Private mrdoEnvironment     As rdoEnvironment
Private mrdoConnection      As rdoConnection

....

   rdoEngine.rdoDefaultCursorDriver = rdUseOdbc
    Set mrdoEnvironment = rdoEngine.rdoCreateEnvironment("", "", "")
        
    ' if DSN string is initialized
    If mstrODBCDSNStr <> vbNullString Then
        Set mrdoConnection = mrdoEnvironment.OpenConnection("", rdDriverNoPrompt, , mstrODBCDSNStr)
        
        ' verify if connection succeed
        fblnConnectToODBC = Not (mrdoConnection Is Nothing)
    End If

.....
mstrODBCDSNStr is a string that must have the following form:
"DSN=DOT32;UID=admin;PWD=orange"

where "DOT32" is the datasource name
"admin" is the user name
and "orange" is the password of the ODBC connection

hope it's what you want.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform