Solved

RDO connect to server

Posted on 1998-11-10
8
537 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

733 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