Solved

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

Posted on 1998-01-26
2
234 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

910 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

16 Experts available now in Live!

Get 1:1 Help Now