?
Solved

Creating a DSN on a user's machine or a DSNless connection

Posted on 1998-01-26
2
Medium Priority
?
244 Views
Last Modified: 2008-02-01
I want to be able to either of two things.
1) Either create a DSN on the user's machine, or
2) Know the syntax for a DSN-less connection of the following DSN.

Here is the DSN that I want to transform in either case:

Data Source Name:   CLS
Description:
Server:             Enterprise
Network Address:    enterprise.capecod.net, 1433
Network Library:    DBMSSOCN
uncheck   User Trusted Connection
Database Name:      CLS
Language Name:      (Default)
checked   Generate Stored Procedures for Prepared Statements
checked   Use ANSI Quoted Identifiers
checked   User ANSI Nulls, Padding and Warnings
uncheck   Convert OEM to ANSI chracters
0
Comment
Question by:clsmaster
[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 Comments
 
LVL 4

Accepted Solution

by:
rantanen earned 800 total points
ID: 1453567
clsmaster, here are examples from MS documentation for different possibilities to open a connection

Dim cnn1 As ADODB.Connection
Dim cnn2 As ADODB.Connection
Dim cnn3 As ADODB.Connection
Dim cnn4 As ADODB.Connection

' Open a connection without using a Data Source Name (DSN).
Set cnn1 = New ADODB.Connection
cnn1.ConnectionString = "driver={SQL Server};" & _
      "server=bigsmile;uid=sa;pwd=pwd;database=pubs"
cnn1.ConnectionTimeout = 30
cnn1.Open
      
' Open a connection using a DSN and ODBC tags.
Set cnn2 = New ADODB.Connection
cnn2.ConnectionString = "DSN=Pubs;UID=sa;PWD=pwd;"
cnn2.Open
      
' Open a connection using a DSN and OLE DB tags.
Set cnn3 = New ADODB.Connection
cnn3.ConnectionString = Data Source=Pubs;UserID=sa;Password=pwd;"
cnn3.Open
      
' Open a connection using a DSN and individual
' arguments instead of a connection string.
Set cnn4 = New ADODB.Connection
cnn4.Open "Pubs", "sa", "pwd"


0
 

Author Comment

by:clsmaster
ID: 1453568
Thanks that looks like what I needed.  The first one is probably the one I'll use.

0

Featured Post

Independent Software Vendors: 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

770 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