Solved

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

Posted on 1998-01-26
2
233 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
2 Comments
 
LVL 4

Accepted Solution

by:
rantanen earned 200 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

708 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

13 Experts available now in Live!

Get 1:1 Help Now