Advertisement

07.18.2008 at 03:27PM PDT, ID: 23578425
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Creating an ODBC connection via VBA utilizing a generic username and password

Asked by swedishtongue in Access Coding/Macros, Microsoft Access Database

Tags: , , ,

i have created the following code to automatically set up an ODBC connection in my access database. this code works great if i use the trusted connection option but when i try and give it a generic user name and password it fails. Anyone know what i am doing wrong?

PS i have manually set up the user name and password and they work just fineStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Option Compare Database
 
Option Explicit
 
'Const ODBC_ADD_SYS_DSN = 1      'Add a user data source
Const ODBC_CONFIG_SYS_DSN = 2    'Configure (edit) data source
Const ODBC_REMOVE_SYS_DSN = 3    'Remove data source
Const ODBC_ADD_SYS_DSN = 4       'Add a system data source
 
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal _
   hwndParent As Long, ByVal fRequest As Long, ByVal _
   lpszDriver As String, ByVal lpszAttributes As String) As Long
                    
 
Function Build_SystemDSN()
  
    Dim Driver As String
    Dim Ret As Long
    Dim Attributes As String
 
    Driver = "SQL Server"
    'attributes are the connection information
    
    Attributes = "server=ANSRLTR" & Chr(0)
    Attributes = Attributes & "DSN=DSN_Temp" & Chr(0)
    Attributes = Attributes & "Database=ANSRLTR_Prod" & Chr(0)
    'use this line if you want to use the users name and password
    'Attributes = Attributes & "Trusted_Connection=Yes" & Chr(0)
    'use this line if you are adding a username and password
    Attributes = Attributes & "Uid=Temp;" & Chr(0) & "Pwd=TempID" & Ch(0)
 
      Ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, Driver, Attributes)
   
   
   'ret is equal to 1 on success and 0 if there is an error
   If Ret <> 1 Then
       MsgBox "DSN Creation Failed"
   End If
 
 
End Function
[+][-]07.18.2008 at 04:09PM PDT, ID: 22040555

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:12PM PDT, ID: 22040566

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:14PM PDT, ID: 22040569

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:15PM PDT, ID: 22040577

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:22PM PDT, ID: 22040597

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database
Tags: miscrosoft, Access, 2003, shared application
Sign Up Now!
Solution Provided By: wildboy85
Participating Experts: 1
Solution Grade: B
 
 
[+][-]07.18.2008 at 04:23PM PDT, ID: 22040601

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:26PM PDT, ID: 22040610

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:29PM PDT, ID: 22040625

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:30PM PDT, ID: 22040630

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:39PM PDT, ID: 22040665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:42PM PDT, ID: 22040680

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:43PM PDT, ID: 22040683

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:10PM PDT, ID: 22040788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:13PM PDT, ID: 22040815

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:14PM PDT, ID: 22040833

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:15PM PDT, ID: 22040840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:25PM PDT, ID: 22040870

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628