robertbwainwright
Registered User.
- Local time
- Yesterday, 23:37
- Joined
- May 2, 2012
- Messages
- 62
Hi,
I would like to use a connection string to run queries that I have created in Access 2007. In the past the odbc link prompted the user for an ID and Password. I would like to just pass the ID and Password in VBA via a connection string, but I have never done this in the past, and I can not find info on this site or through searching the web on a tutorial on how to do so.
Currently I am using the following command to run my queries:
DoCmd.OpenQuery "qryStartTime"
From what I gather my connection string should look like this (copied from info I found):
Dim sConStr as String
sConStr = "DSN=MY400;UID=HARNER;PWD=SECRET;"
My problem is that I don't know where to use my string. Maybe I am using the wrong command to run my query? Sorry for my ignorance on this topic, but I appericate any help on this.
Robert
I would like to use a connection string to run queries that I have created in Access 2007. In the past the odbc link prompted the user for an ID and Password. I would like to just pass the ID and Password in VBA via a connection string, but I have never done this in the past, and I can not find info on this site or through searching the web on a tutorial on how to do so.
Currently I am using the following command to run my queries:
DoCmd.OpenQuery "qryStartTime"
From what I gather my connection string should look like this (copied from info I found):
Dim sConStr as String
sConStr = "DSN=MY400;UID=HARNER;PWD=SECRET;"
My problem is that I don't know where to use my string. Maybe I am using the wrong command to run my query? Sorry for my ignorance on this topic, but I appericate any help on this.
Robert