Solved

RDO connect to server

Posted on 1998-11-10
8
523 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
Comment Utility
Edited text of question
0
 
LVL 2

Expert Comment

by:vspeter
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:lbk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thnx
LK
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

10 Experts available now in Live!

Get 1:1 Help Now