Solved

Visual Basic

Posted on 2003-11-10
4
837 Views
Last Modified: 2012-06-21
Urgent! How to use rdoEngine.rdoRegisterDataSource to create SQL Server data source.  Below is the rdoRegisterDataSource paranmeter:rdoRegisterDataSource(DSN As String, Driver As String, Silent As Boolean, Attributes As String)

Please I need a complete parameters passing example.

TQ
0
Comment
Question by:coolkgy
[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
  • 2
4 Comments
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 9720213
Hello,

Try with this link:

http://internettrash.com/users/fdb/rdo.htm

All the best,
V.Thandava krishna
0
 
LVL 1

Accepted Solution

by:
vkaushik earned 125 total points
ID: 9720442
Hi use this function...
You will need to change the attributes to the actuals i.e.
if Sever/instance name is - VISHALK\VISHAKAU

Address:\\VISHALK\pipe\MSSQL$VISHAKAU\sql\query

\\VISHALK is the Server m/c name
MSSQL$VISHAKAU is the sql server instance name
Database--> The database name

username is sa
pwd is blank

Private Sub RegisterDataSource()
Dim en As rdoEnvironment
Dim cnTest As rdoConnection
Dim strAttribs As String
' Build keywords string.
strAttribs = "Description=" _
        & "SQL Server on server SEQUEL" _
  & Chr$(13) & "OemToAnsi=No" _
  & Chr$(13) & "SERVER=VISHALK\VISHAKAU" _
  & Chr$(13) & "Network=DBNMPNTW" _
  & Chr$(13) & "Database=TEST" _
  & Chr$(13) & "Address=\\VISHALK\pipe\MSSQL$VISHAKAU\sql\query"
 
' Create new registered DSN.
rdoEngine.rdoRegisterDataSource "Example", _
         "SQL Server", True, strAttribs
' Open the database.
Set en = rdoEngine.rdoEnvironments(0)
Set cnTest = en.OpenConnection( _
  dsname:="Example", _
  Prompt:=rdDriverNoPrompt, _
  Connect:="UID=sa;PWD=;")
 
End Sub

I have tested it and it works. You can find the Address (pipe address from Client Network Libraries alias tab in Microsoft SQL server program group.

Cheers,
Kaushik
0
 
LVL 1

Expert Comment

by:vkaushik
ID: 9720447
TEST is a sample database..you can put inthe database you want to connect to, which is available on your SQL server.
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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Starting up a Project

707 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