?
Solved

Visual Basic

Posted on 2003-11-10
4
Medium Priority
?
846 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 250 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

801 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