Solved

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

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

717 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