Solved

Visual Basic

Posted on 2003-11-10
4
773 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
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.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

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

12 Experts available now in Live!

Get 1:1 Help Now