Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual Basic

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

636 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