Solved

Visual Basic

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

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

685 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