Solved

RDO connect to server

Posted on 1998-11-10
8
527 Views
Last Modified: 2013-12-25
The following problem persists... since I'm rather new to ODBC and RDO, I hope you will be able to help me. I'm trying to connect to a db on a ODBC server. The following code will do so, if the db is on the development computer.

    Set cnDays = New rdoConnection
    With cnDays
    .Connect = "uid=;pwd=;dsn=sbqvtest;"
    .CursorDriver = rdUseOdbc
    .EstablishConnection rdDriverNoPrompt, True
    Do While .StillConnecting
        DoEvents
    Loop
    End With

So the DSN is defined on my computer (Scratchy). However, if I want to connect to a db on a different computer (i.e. Quimby), how do I do so. Trying the following always gives me a "DSN not found, etc" error

    Set cnDays = New rdoConnection
    With cnDays
    .Connect = "Server=quimby;uid=;pwd=;dsn=sbqv_test_2;"
    .CursorDriver = rdUseOdbc
    .EstablishConnection rdDriverNoPrompt, True
    Do While .StillConnecting
        DoEvents
    Loop
    End With

If I set the prompt variable to 0, it prompts me for a data source, but on MY computer, not on the specified server...
The DB is an access driver, specified as a system DSN. All computers are on the same network, but the goal is to access it over the Inet...
Thanks in advance
0
Comment
Question by:lbk
8 Comments
 
LVL 1

Author Comment

by:lbk
ID: 1497559
Edited text of question
0
 
LVL 2

Expert Comment

by:vspeter
ID: 1497560
You would set a system DSN similar to how you did with the database on the development machine

however for this instance, click on the 'System Database ...' button on the ODBC Microsoft Access 97 Setup screen. It allows you to select the system database file which can be locate on remote computer before select the database.

Give that a try and see it goes. Cheers,


0
 
LVL 1

Author Comment

by:lbk
ID: 1497561
Sorry, I can't change the setup on the server side. The database has to be on Quimby, ODCB on quimby set up to have an entry for the DB. All I have power over is the client code, as demonstrated in the example above. It seems to me that the RDO endgine doesn't want to recognice the server name/location and therefor finds the local ODBC engine, rather than the one on Quimby
0
 
LVL 2

Expert Comment

by:Poddy
ID: 1497562
DOn't use DSNs,.

Use DSN-less connections, and define your parameters in the client side code (Or it's initialization settings - registry, ini-file, etc)



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:lbk
ID: 1497563
OK, can you give me code?
Something like this:

  Set cnConnection = New rdConnection
  cnConnection.Connect = XXXXX
  cnConnection.EstablishConnection XXX,XXX,...

  Etc, etc

thx in advance
0
 
LVL 1

Author Comment

by:lbk
ID: 1497564
none of this is working correctly. Turns out I need to use RDS with an appropriate business object. However, that donb't work for some reason either. Seems that the dependency information for one of the dlls is missing.
0
 
LVL 3

Accepted Solution

by:
hakyemez earned 100 total points
ID: 1497565
You Must DSN-less ODBC connection using the OpenConnection method against the default rdoEnvironment.
----------------------------------------------------------
Dim en as rdoEnvironment
Dim cn as rdoConnection

Set en = rdoEnvironments(0)
Set cn = en.OpenConnection(dsName:="", _
    Prompt:=rdDriverNoPrompt, _
    Connect:="uid=SA;pwd=;driver={SQL Server};" _
        & "server=SEQUEL;database=PUBS;")

Note:
---------------------------------------------
UID (UserName)= SA
PWD (Password)= <Blank>
Server        = SEQUEL (your sql server name)
Database      = PUBS   (your database name)
0
 
LVL 1

Author Comment

by:lbk
ID: 1497566
Thnx
LK
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now