dbTalk Databases Forums  

Help: DNS less connection to SQL Server

comp.databases.ms-access comp.databases.ms-access


Discuss Help: DNS less connection to SQL Server in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Devenish
 
Posts: n/a

Default Help: DNS less connection to SQL Server - 06-07-2011 , 02:56 PM






I know this is a well trodden path but I am confused. I need to
connect an Access 2010 database to a SQL Server. I make two different
connections:

1 linking a table:
Dim aTable as DAO.TableDef
....
aTable.connect = aConnectionString

2 a ADODB connection
Dim theConnection As ADODB.Connection
Set theConnection = New ADODB.Connection
theConnection.Open theConnectionString

I am content with most of each connection string but am confused about
user id and password. Sometimes I seem to need:
UID= username; PWD= password

and at others:
User ID = username; Password = password

Can someone please explain when to use one form and when to use the
other.

I promise to note it down and remember it for future use.

Reply With Quote
  #2  
Old   
Bob Barrows
 
Posts: n/a

Default Re: DNS less connection to SQL Server - 06-07-2011 , 03:15 PM






Jim Devenish wrote:
Quote:
I know this is a well trodden path but I am confused. I need to
connect an Access 2010 database to a SQL Server. I make two different
connections:

1 linking a table:
Dim aTable as DAO.TableDef
...
aTable.connect = aConnectionString

2 a ADODB connection
Dim theConnection As ADODB.Connection
Set theConnection = New ADODB.Connection
theConnection.Open theConnectionString

I am content with most of each connection string but am confused about
user id and password. Sometimes I seem to need:
UID= username; PWD= password
That's the old ODBC syntax - use it when you are using ODBC, such as with
DAO connections and with linked tables.

Quote:
and at others:
User ID = username; Password = password

That's the OLE DB syntax - OLE DB is used by ADODB. Where it gets confusing
is that there is an OLE DB provider for ODBC databases (it's called
MSDASQL). This provider is used when you need to use ADO to communicate via
an ODBC driver. It's not really recommended since you are forcing there to
be an extra layer of software between your code and the database: code->OLE
DB->ODBC->database. When using ADO to communicate with a database for which
a native OLE DB provider exists (such as SQL Server) it is preferable to use
the native OLE DB provider (SQLOLEDB for SQL Server).
When using a native provider, the OLE DB syntax should be used.
It seems that when using this MSDASQL provider, either syntax is acceptable.
I tend to use the UID/PWD syntax whenever I'm using ODBC, whether I'm using
ADO or not, but that's a matter of preference.

Quote:
Can someone please explain when to use one form and when to use the
other.

I promise to note it down and remember it for future use.
.... or just refer to www.connectionstrings.com ...

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.