473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Connect using file DSN in code using a DAO function

Hi All,
I am using Access 2003. I have a function that I have been using to log
on to linked tables using the system ODBC and it has been working great.
Now I want to do the same thing using a file dsn that connect to a
database using windows integrated security and I can't seem to get the
syntax right.

This is the only DAO code I use any more, is there an ADO equivalent?

Please take a look at this tell me what's wrong, or suggest a better
function!

Thanks!
Kathy

Function OpenConnectionX()

'Sets connection to ODBC datasource defined by DSN DV1.dsn
'Prevents the user from having to log into Db
'Requires DAO reference

Dim wrkJet As Workspace
Dim dbsSTL As Database

Set wrkJet = DBEngine.Workspaces(0)

Set dbsSTL = wrkJet.OpenDatabase("DV1.dsn", dbDriverNoPrompt, True, _
"ODBC;DATABASE=DV1;UID=myusername;PWD=;DSN = C:\Program Files\Common
Files\ODBC\Data Sources/DV1.dsn")

End Function
*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
2 6356
first stop should be Carl Prothman's website. He has connection
strings for just about everything. I think it's now
www.carlprothman.com

Nov 13 '05 #2
Thanks! That's a great resource. I also learned that I don't need this
function at all with a file DSN! It is embedded in the file.

Thanks again for your reply,
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
2
by: Sims | last post by:
Hi, I am trying to tidy up my code and now i am looking at my database work. Now correct me if i am wrong, (I am using mysql_connect). Lets assume a few functions... ...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
3
by: beliavsky | last post by:
I want to write a function that writes to an output file if specified and otherwise to standard output. How can I connect a file object to standard output in the code below? I could use an if...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
1
by: delset | last post by:
This is my first post on this form so please bear with me if i don't give all the needed info. My problem seems simple but i googled for hours and have not yet found anything that can help with my...
1
by: GNoter | last post by:
Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on...
14
by: Khan | last post by:
Hello, I want to connect my intranet server (with php/apache) to the other informix database server, But I didnt it. I dont know how i can do it? Can i use php_informix extensions for example...
8
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.